Skip to content

armgit / krita

Public Imported from GitHub
0

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.txt
index c26cf5a3b9..aafe60fe81 100644
--- a/libs/ui/CMakeLists.txt
+++ b/libs/ui/CMakeLists.txt
@@ -663,7 +663,6 @@ target_link_libraries(kritaui
Qt${QT_MAJOR_VERSION}::Network
Qt${QT_MAJOR_VERSION}::Concurrent
- Qt${QT_MAJOR_VERSION}::Qml
Eigen3::Eigen
Boost::boost
diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cpp
index 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.qml
index 393e0a8c24..5e9d226eb5 100644
--- a/plugins/dockers/textproperties/qml/BaselineShift.qml
+++ b/plugins/dockers/textproperties/qml/BaselineShift.qml
@@ -7,7 +7,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
TextPropertyBase {
propertyName: i18nc("@label", "Baseline-Shift")
diff --git a/plugins/dockers/textproperties/qml/FontSize.qml b/plugins/dockers/textproperties/qml/FontSize.qml
index 99fe5a798d..8d36b0db72 100644
--- a/plugins/dockers/textproperties/qml/FontSize.qml
+++ b/plugins/dockers/textproperties/qml/FontSize.qml
@@ -7,7 +7,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
TextPropertyBase {
propertyName: i18nc("@label:spinbox", "Font Size");
diff --git a/plugins/dockers/textproperties/qml/FontSizeAdjust.qml b/plugins/dockers/textproperties/qml/FontSizeAdjust.qml
index 09c18c3ec7..f241a907f2 100644
--- a/plugins/dockers/textproperties/qml/FontSizeAdjust.qml
+++ b/plugins/dockers/textproperties/qml/FontSizeAdjust.qml
@@ -7,7 +7,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
TextPropertyBase {
propertyName: i18nc("@label:spinbox", "Font Size Adjust");
diff --git a/plugins/dockers/textproperties/qml/FontStyle.qml b/plugins/dockers/textproperties/qml/FontStyle.qml
index 7a8fb52b15..10aad5b137 100644
--- a/plugins/dockers/textproperties/qml/FontStyle.qml
+++ b/plugins/dockers/textproperties/qml/FontStyle.qml
@@ -7,7 +7,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
CollapsibleGroupProperty {
propertyName: i18nc("@label", "Font Style");
diff --git a/plugins/dockers/textproperties/qml/LetterSpacing.qml b/plugins/dockers/textproperties/qml/LetterSpacing.qml
index 5fe334ae13..17154bb5d4 100644
--- a/plugins/dockers/textproperties/qml/LetterSpacing.qml
+++ b/plugins/dockers/textproperties/qml/LetterSpacing.qml
@@ -7,7 +7,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
TextPropertyBase {
propertyName: i18nc("@label:spinbox", "Letter Spacing");
diff --git a/plugins/dockers/textproperties/qml/LineHeight.qml b/plugins/dockers/textproperties/qml/LineHeight.qml
index 9342354b58..92eb2dc9aa 100644
--- a/plugins/dockers/textproperties/qml/LineHeight.qml
+++ b/plugins/dockers/textproperties/qml/LineHeight.qml
@@ -7,7 +7,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
TextPropertyBase {
propertyName: i18nc("@label", "Line Height");
diff --git a/plugins/dockers/textproperties/qml/TabSize.qml b/plugins/dockers/textproperties/qml/TabSize.qml
index 1abbaa2247..7751f07f09 100644
--- a/plugins/dockers/textproperties/qml/TabSize.qml
+++ b/plugins/dockers/textproperties/qml/TabSize.qml
@@ -7,7 +7,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
TextPropertyBase {
propertyName: i18nc("@title:group", "Tab Size");
diff --git a/plugins/dockers/textproperties/qml/TextIndent.qml b/plugins/dockers/textproperties/qml/TextIndent.qml
index 2f84f72bc8..0f0e1613f5 100644
--- a/plugins/dockers/textproperties/qml/TextIndent.qml
+++ b/plugins/dockers/textproperties/qml/TextIndent.qml
@@ -7,7 +7,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
CollapsibleGroupProperty {
propertyName: i18nc("@title:group", "Text Indent");
diff --git a/plugins/dockers/textproperties/qml/WordSpacing.qml b/plugins/dockers/textproperties/qml/WordSpacing.qml
index c2c81c01e3..7ef3d9d9a2 100644
--- a/plugins/dockers/textproperties/qml/WordSpacing.qml
+++ b/plugins/dockers/textproperties/qml/WordSpacing.qml
@@ -7,7 +7,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
TextPropertyBase {
propertyName: i18nc("@title:group", "Word Spacing");
diff --git a/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml b/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml
index 75acd93503..f29c691781 100644
--- a/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml
+++ b/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml
@@ -6,7 +6,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.5
import org.krita.tools.text 1.0
-import org.krita.qml 1.0
+import org.krita.components 1.0
SvgTextLabel {
id: glyphLabel;
diff --git a/qmlmodules/CMakeLists.txt b/qmlmodules/CMakeLists.txt
index 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.txt
new file mode 100644
index 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.cpp
new file mode 100644
index 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.h
similarity index 69%
rename from qmlmodules/libqml/KritaQmlPlugin.h
rename to qmlmodules/components/KritaQmlComponentsPlugin.h
index 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_OBJECT
Q_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.cpp
similarity index 100%
rename from qmlmodules/libqml/SvgTextLabel.cpp
rename to qmlmodules/components/SvgTextLabel.cpp
diff --git a/qmlmodules/libqml/SvgTextLabel.h b/qmlmodules/components/SvgTextLabel.h
similarity index 100%
rename from qmlmodules/libqml/SvgTextLabel.h
rename to qmlmodules/components/SvgTextLabel.h
diff --git a/qmlmodules/libqml/qml/DoubleSpinBox.qml b/qmlmodules/components/qml/DoubleSpinBox.qml
similarity index 100%
rename from qmlmodules/libqml/qml/DoubleSpinBox.qml
rename to qmlmodules/components/qml/DoubleSpinBox.qml
diff --git a/qmlmodules/libqml/CMakeLists.txt b/qmlmodules/libqml/CMakeLists.txt
deleted file mode 100644
index 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.cpp
deleted file mode 100644
index 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"