Mon, 27 Jun 2022 01:57:06 +0300
Further use APPNAME macro
--- a/CMakeLists.txt Mon Jun 27 01:49:20 2022 +0300 +++ b/CMakeLists.txt Mon Jun 27 01:57:06 2022 +0300 @@ -1,4 +1,5 @@ project(LDForge) +cmake_minimum_required(VERSION 2.8.12) set(VERSION_MAJOR 1) set(VERSION_MINOR 0) set(VERSION_PATCH 0) @@ -7,9 +8,13 @@ if (NOT ${VERSION_PATCH} EQUAL 0) set(VERSION_STRING "${VERSION_STRING}.${VERSION_PATCH}") endif() +string(TOLOWER ${PROJECT_NAME} TARGET_NAME) +add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR}) +add_definitions(-DVERSION_MINOR=${VERSION_MINOR}) +add_definitions(-DVERSION_PATCH=${VERSION_PATCH}) +add_definitions(-DAPPNAME="${PROJECT_NAME}") +add_definitions(-DVERSION_STRING="${VERSION_STRING}") -string(TOLOWER ${PROJECT_NAME} TARGET_NAME) -cmake_minimum_required(VERSION 2.8.12) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") set(OpenGL_GL_PREFERENCE GLVND) find_package(Qt6 COMPONENTS Core Widgets OpenGL UiPlugin OpenGLWidgets) @@ -133,12 +138,6 @@ include_directories("${PROJECT_BINARY_DIR}/src") include_directories("${PROJECT_SOURCE_DIR}") -add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR}) -add_definitions(-DVERSION_MINOR=${VERSION_MINOR}) -add_definitions(-DVERSION_PATCH=${VERSION_PATCH}) -add_definitions(-DAPPNAME="${PROJECT_NAME}") -add_definitions(-DVERSION_STRING="${VERSION_STRING}") - if (NOT MSVC) if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
--- a/widgets/designerplugins.cpp Mon Jun 27 01:49:20 2022 +0300 +++ b/widgets/designerplugins.cpp Mon Jun 27 01:57:06 2022 +0300 @@ -3,7 +3,7 @@ #include "widgets/matrixeditor.h" #include "widgets/colorbutton.h" -LDForgeWidgetCollection::LDForgeWidgetCollection(QObject* parent) : +PluginCollection::PluginCollection(QObject* parent) : QObject{parent} { this->interfaces.append(new Vec3EditorPlugin{this}); @@ -11,7 +11,7 @@ this->interfaces.append(new ColorButtonPlugin{this}); } -QList<QDesignerCustomWidgetInterface*> LDForgeWidgetCollection::customWidgets() const +QList<QDesignerCustomWidgetInterface*> PluginCollection::customWidgets() const { return this->interfaces; } @@ -23,7 +23,7 @@ QString Vec3EditorPlugin::group() const { - return "LDForge"; + return APPNAME; } QString Vec3EditorPlugin::toolTip() const @@ -63,7 +63,7 @@ QString MatrixEditorPlugin::group() const { - return "LDForge"; + return APPNAME; } QString MatrixEditorPlugin::toolTip() const @@ -104,7 +104,7 @@ QString ColorButtonPlugin::group() const { - return "LDForge"; + return APPNAME; } QString ColorButtonPlugin::toolTip() const
--- a/widgets/designerplugins.h Mon Jun 27 01:49:20 2022 +0300 +++ b/widgets/designerplugins.h Mon Jun 27 01:57:06 2022 +0300 @@ -2,7 +2,7 @@ #include <QObject> #include <QDesignerCustomWidgetInterface> -class LDForgeWidgetCollection final : public QObject, public QDesignerCustomWidgetCollectionInterface +class PluginCollection final : public QObject, public QDesignerCustomWidgetCollectionInterface { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qgis.customwidgets") @@ -10,7 +10,7 @@ // QDesignerCustomWidgetCollectionInterface interface QList<QDesignerCustomWidgetInterface*> interfaces; public: - LDForgeWidgetCollection(QObject* parent = nullptr); + PluginCollection(QObject* parent = nullptr); QList<QDesignerCustomWidgetInterface*> customWidgets() const override; };