Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Rename qml module org.krita.qml into org.krita.components
Dmitry Kazakov37ce03ca46e0
diff --git a/libs/ui/CMakeLists.txt b/libs/ui/CMakeLists.txtindex c26cf5a3b9..aafe60fe81 100644--- a/libs/ui/CMakeLists.txt+++ b/libs/ui/CMakeLists.txt@@ -663,7 +663,6 @@ target_link_libraries(kritauiQt${QT_MAJOR_VERSION}::NetworkQt${QT_MAJOR_VERSION}::Concurrent- Qt${QT_MAJOR_VERSION}::QmlEigen3::EigenBoost::boostdiff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cppindex e34c894ff3..810573b617 100644--- a/libs/ui/KisApplication.cpp+++ b/libs/ui/KisApplication.cpp@@ -35,7 +35,6 @@#include <QImageReader>#include <QImageWriter>#include <QThread>-#include <QQmlEngine>#include <klocalizedstring.h>#include <kdesktopfile.h>@@ -201,8 +200,6 @@ KisApplication::KisApplication(const QString &key, int &argc, char **argv)QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());- qmlRegisterModule("org.krita.qml", 1, 0);-setApplicationDisplayName("Krita");setApplicationName("krita");// Note: Qt docs suggest we set this, but if we do, we get resource paths of the form of krita/krita, which is weird.diff --git a/plugins/dockers/textproperties/qml/BaselineShift.qml b/plugins/dockers/textproperties/qml/BaselineShift.qmlindex 393e0a8c24..5e9d226eb5 100644--- a/plugins/dockers/textproperties/qml/BaselineShift.qml+++ b/plugins/dockers/textproperties/qml/BaselineShift.qml@@ -7,7 +7,7 @@ import QtQuick 2.0import QtQuick.Controls 2.0import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0TextPropertyBase {propertyName: i18nc("@label", "Baseline-Shift")diff --git a/plugins/dockers/textproperties/qml/FontSize.qml b/plugins/dockers/textproperties/qml/FontSize.qmlindex 99fe5a798d..8d36b0db72 100644--- a/plugins/dockers/textproperties/qml/FontSize.qml+++ b/plugins/dockers/textproperties/qml/FontSize.qml@@ -7,7 +7,7 @@ import QtQuick 2.0import QtQuick.Controls 2.0import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0TextPropertyBase {propertyName: i18nc("@label:spinbox", "Font Size");diff --git a/plugins/dockers/textproperties/qml/FontSizeAdjust.qml b/plugins/dockers/textproperties/qml/FontSizeAdjust.qmlindex 09c18c3ec7..f241a907f2 100644--- a/plugins/dockers/textproperties/qml/FontSizeAdjust.qml+++ b/plugins/dockers/textproperties/qml/FontSizeAdjust.qml@@ -7,7 +7,7 @@ import QtQuick 2.15import QtQuick.Controls 2.15import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0TextPropertyBase {propertyName: i18nc("@label:spinbox", "Font Size Adjust");diff --git a/plugins/dockers/textproperties/qml/FontStyle.qml b/plugins/dockers/textproperties/qml/FontStyle.qmlindex 7a8fb52b15..10aad5b137 100644--- a/plugins/dockers/textproperties/qml/FontStyle.qml+++ b/plugins/dockers/textproperties/qml/FontStyle.qml@@ -7,7 +7,7 @@ import QtQuick 2.15import QtQuick.Controls 2.0import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0CollapsibleGroupProperty {propertyName: i18nc("@label", "Font Style");diff --git a/plugins/dockers/textproperties/qml/LetterSpacing.qml b/plugins/dockers/textproperties/qml/LetterSpacing.qmlindex 5fe334ae13..17154bb5d4 100644--- a/plugins/dockers/textproperties/qml/LetterSpacing.qml+++ b/plugins/dockers/textproperties/qml/LetterSpacing.qml@@ -7,7 +7,7 @@ import QtQuick 2.0import QtQuick.Controls 2.0import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0TextPropertyBase {propertyName: i18nc("@label:spinbox", "Letter Spacing");diff --git a/plugins/dockers/textproperties/qml/LineHeight.qml b/plugins/dockers/textproperties/qml/LineHeight.qmlindex 9342354b58..92eb2dc9aa 100644--- a/plugins/dockers/textproperties/qml/LineHeight.qml+++ b/plugins/dockers/textproperties/qml/LineHeight.qml@@ -7,7 +7,7 @@ import QtQuick 2.15import QtQuick.Controls 2.15import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0TextPropertyBase {propertyName: i18nc("@label", "Line Height");diff --git a/plugins/dockers/textproperties/qml/TabSize.qml b/plugins/dockers/textproperties/qml/TabSize.qmlindex 1abbaa2247..7751f07f09 100644--- a/plugins/dockers/textproperties/qml/TabSize.qml+++ b/plugins/dockers/textproperties/qml/TabSize.qml@@ -7,7 +7,7 @@ import QtQuick 2.15import QtQuick.Controls 2.15import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0TextPropertyBase {propertyName: i18nc("@title:group", "Tab Size");diff --git a/plugins/dockers/textproperties/qml/TextIndent.qml b/plugins/dockers/textproperties/qml/TextIndent.qmlindex 2f84f72bc8..0f0e1613f5 100644--- a/plugins/dockers/textproperties/qml/TextIndent.qml+++ b/plugins/dockers/textproperties/qml/TextIndent.qml@@ -7,7 +7,7 @@ import QtQuick 2.0import QtQuick.Controls 2.0import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0CollapsibleGroupProperty {propertyName: i18nc("@title:group", "Text Indent");diff --git a/plugins/dockers/textproperties/qml/WordSpacing.qml b/plugins/dockers/textproperties/qml/WordSpacing.qmlindex c2c81c01e3..7ef3d9d9a2 100644--- a/plugins/dockers/textproperties/qml/WordSpacing.qml+++ b/plugins/dockers/textproperties/qml/WordSpacing.qml@@ -7,7 +7,7 @@ import QtQuick 2.0import QtQuick.Controls 2.0import QtQuick.Layouts 1.12import org.krita.flake.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0TextPropertyBase {propertyName: i18nc("@title:group", "Word Spacing");diff --git a/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml b/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qmlindex 75acd93503..f29c691781 100644--- a/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml+++ b/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml@@ -6,7 +6,7 @@import QtQuick 2.15import QtQuick.Controls 2.5import org.krita.tools.text 1.0-import org.krita.qml 1.0+import org.krita.components 1.0SvgTextLabel {id: glyphLabel;diff --git a/qmlmodules/CMakeLists.txt b/qmlmodules/CMakeLists.txtindex 5f8a4c990a..3c357135a2 100644--- a/qmlmodules/CMakeLists.txt+++ b/qmlmodules/CMakeLists.txt@@ -1 +1 @@-add_subdirectory(libqml)+add_subdirectory(components)diff --git a/qmlmodules/components/CMakeLists.txt b/qmlmodules/components/CMakeLists.txtnew file mode 100644index 0000000000..e585fcec25--- /dev/null+++ b/qmlmodules/components/CMakeLists.txt@@ -0,0 +1,56 @@+if (QT_MAJOR_VERSION STREQUAL "6")++ ecm_add_qml_module(kritaqmlcomponents+ URI "org.krita.components"+ VERSION 1.0+ SHARED+ GENERATE_PLUGIN_SOURCE+ )++ target_sources(kritaqmlcomponents+ PRIVATE+ SvgTextLabel.cpp+ SvgTextLabel.h+ )++else ()+ ecm_add_qml_module(kritaqmlcomponents+ URI "org.krita.components"+ VERSION 1.0+ CLASSNAME KritaQmlComponentsPlugin+ )++ target_sources(kritaqmlcomponents+ PRIVATE+ KritaQmlComponentsPlugin.cpp+ KritaQmlComponentsPlugin.h+ SvgTextLabel.cpp+ SvgTextLabel.h+ )++endif ()++ecm_target_qml_sources(kritaqmlcomponents SOURCES+ qml/DoubleSpinBox.qml+)++target_link_libraries(kritaqmlcomponents+ PRIVATE+ kritaui+ Qt::Qml+ Qt::Quick+ Qt::QuickControls2+)++ecm_finalize_qml_module(kritaqmlcomponents DESTINATION ${KDE_INSTALL_QMLDIR})++# Note: we don't need ecm_generate_qmltypes, in Qt6 it is autogenerated+# by ecm_finalize_qml_module++# Note: the ecm documentation prescribes this line but it is not needed,+# since all the installation work is done by ecm_finalize_qml_module+#+# install(TARGETS kritaqmlcomponents ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})+++diff --git a/qmlmodules/components/KritaQmlComponentsPlugin.cpp b/qmlmodules/components/KritaQmlComponentsPlugin.cppnew file mode 100644index 0000000000..5b690dad3e--- /dev/null+++ b/qmlmodules/components/KritaQmlComponentsPlugin.cpp@@ -0,0 +1,38 @@+/*+ * SPDX-FileCopyrightText: 2025 Halla Rempt <[email protected]>+ *+ * SPDX-License-Identifier: LGPL-2.0-or-later+ */++#include "KritaQmlComponentsPlugin.h"++#include <QObject>+#include <KisStaticInitializer.h>++#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)+#error "This plugin implementation is to be used with Qt5 only!\n"+ "Qt6 should generate it itself with GENERATE_PLUGIN_SOURCE!"+#endif++KIS_DECLARE_STATIC_INITIALIZER {+ qmlRegisterModule("org.krita.components", 1, 0);+}++KritaQmlComponentsPlugin::KritaQmlComponentsPlugin(QObject *parent)+ : QQmlExtensionPlugin(parent)+{+}++void KritaQmlComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)+{+ Q_UNUSED(engine);+ Q_UNUSED(uri);+}++void KritaQmlComponentsPlugin::registerTypes(const char *uri)+{+ Q_UNUSED(uri);+}++#include "KritaQmlComponentsPlugin.moc"+#include "moc_KritaQmlComponentsPlugin.cpp"diff --git a/qmlmodules/libqml/KritaQmlPlugin.h b/qmlmodules/components/KritaQmlComponentsPlugin.hsimilarity index 69%rename from qmlmodules/libqml/KritaQmlPlugin.hrename to qmlmodules/components/KritaQmlComponentsPlugin.hindex 76fe643817..69993e38b7 100644--- a/qmlmodules/libqml/KritaQmlPlugin.h+++ b/qmlmodules/components/KritaQmlComponentsPlugin.h@@ -3,20 +3,20 @@** SPDX-License-Identifier: LGPL-2.0-or-later*/-#ifndef KRITAQMLPLUGIN_H-#define KRITAQMLPLUGIN_H+#ifndef KRITAQMLCOMPONENTSPLUGIN_H+#define KRITAQMLCOMPONENTSPLUGIN_H#include <QUrl>#include <QQmlEngine>#include <QQmlExtensionPlugin>-class KritaQmlPlugin : public QQmlExtensionPlugin+class KritaQmlComponentsPlugin : public QQmlExtensionPlugin{Q_OBJECTQ_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")public:- KritaQmlPlugin(QObject *parent = nullptr);+ KritaQmlComponentsPlugin(QObject *parent = nullptr);void initializeEngine(QQmlEngine *engine, const char *uri) override;void registerTypes(const char *uri) override;};diff --git a/qmlmodules/libqml/SvgTextLabel.cpp b/qmlmodules/components/SvgTextLabel.cppsimilarity index 100%rename from qmlmodules/libqml/SvgTextLabel.cpprename to qmlmodules/components/SvgTextLabel.cppdiff --git a/qmlmodules/libqml/SvgTextLabel.h b/qmlmodules/components/SvgTextLabel.hsimilarity index 100%rename from qmlmodules/libqml/SvgTextLabel.hrename to qmlmodules/components/SvgTextLabel.hdiff --git a/qmlmodules/libqml/qml/DoubleSpinBox.qml b/qmlmodules/components/qml/DoubleSpinBox.qmlsimilarity index 100%rename from qmlmodules/libqml/qml/DoubleSpinBox.qmlrename to qmlmodules/components/qml/DoubleSpinBox.qmldiff --git a/qmlmodules/libqml/CMakeLists.txt b/qmlmodules/libqml/CMakeLists.txtdeleted file mode 100644index 1336aef325..0000000000--- a/qmlmodules/libqml/CMakeLists.txt+++ /dev/null@@ -1,51 +0,0 @@-if (QT_MAJOR_VERSION STREQUAL "6")-- ecm_add_qml_module(KritaQmlPlugin- URI org.krita.qml- VERSION 1.0- SHARED- GENERATE_PLUGIN_SOURCE- )--target_sources(KritaQmlPlugin- PRIVATE- SvgTextLabel.cpp- SvgTextLabel.h-)--else ()- ecm_add_qml_module(KritaQmlPlugin- URI "org.krita.qml"- VERSION 1.0- CLASSNAME KritaQmlPlugin- )--target_sources(KritaQmlPlugin- PRIVATE- KritaQmlPlugin.cpp- KritaQmlPlugin.h- SvgTextLabel.cpp- SvgTextLabel.h-)--endif ()--ecm_target_qml_sources(KritaQmlPlugin SOURCES- qml/DoubleSpinBox.qml-)--target_link_libraries(KritaQmlPlugin- PRIVATE- kritaui- Qt::Qml- Qt::Quick- Qt::QuickControls2-)--ecm_finalize_qml_module(KritaQmlPlugin DESTINATION ${KDE_INSTALL_QMLDIR})--# Note: the ecm documentation prescribes this line but it is not needed...-#install(TARGETS KritaQmlPlugin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})---diff --git a/qmlmodules/libqml/KritaQmlPlugin.cpp b/qmlmodules/libqml/KritaQmlPlugin.cppdeleted file mode 100644index 5cae9da04b..0000000000--- a/qmlmodules/libqml/KritaQmlPlugin.cpp+++ /dev/null@@ -1,28 +0,0 @@-/*- * SPDX-FileCopyrightText: 2025 Halla Rempt <[email protected]>- *- * SPDX-License-Identifier: LGPL-2.0-or-later- */--#include "KritaQmlPlugin.h"--#include <QObject>--KritaQmlPlugin::KritaQmlPlugin(QObject *parent)- : QQmlExtensionPlugin(parent)-{-}--void KritaQmlPlugin::initializeEngine(QQmlEngine *engine, const char *uri)-{- Q_UNUSED(engine);- Q_UNUSED(uri);-}--void KritaQmlPlugin::registerTypes(const char *uri)-{- Q_UNUSED(uri);-}--#include "KritaQmlPlugin.moc"-#include "moc_KritaQmlPlugin.cpp"