From 7421ff4c62649e288a1c73415568808045292203 Mon Sep 17 00:00:00 2001 From: SeeLook <seelook@gmail.com> Date: Wed, 12 Feb 2025 00:55:21 +0100 Subject: [PATCH] Move Taction to Nootka.Music QML module --- src/CMakeLists.txt | 5 +++++ src/core/CMakeLists.txt | 2 +- src/core/taction.h | 4 +++- src/core/tnootkaqml.cpp | 1 - src/qml/+android/FlyItem.qml | 1 + src/qml/+android/MainMenuMobile.qml | 1 + src/qml/+android/shared/MenuButton.qml | 2 +- src/qml/about/HelpPage.qml | 1 + src/qml/shared/HeadButton.qml | 1 + src/qml/shared/MenuButton.qml | 1 + 10 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8b52a8cf3..5d53c6749 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -152,6 +152,9 @@ include_directories( core/music core/score ) qt_add_qml_module(nootka URI "Nootka.Music" SOURCES + core/taction.cpp + core/taction.h + core/music/tnote.h core/music/tnote.cpp core/music/trhythm.h @@ -185,6 +188,8 @@ qt_add_qml_module(nootka core/score/tmelodypreview.h core/score/tdummychord.cpp core/score/tdummychord.h + DEPENDENCIES + QtQuick ) # qmlRegisterUncreatableType<TmelodyPart>("Score", 1, 0, "TmelodyPart", QStringLiteral("You cannot create an instance of the TcommonInstrument.")); diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 2ca5a36f8..f02e28e34 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -49,7 +49,7 @@ set(LIB_NOOTKACORE_SRC tpath.cpp tmtr.cpp tnootkaqml.cpp - taction.cpp + # taction.cpp tnoofont.cpp minizip/tzip.cpp diff --git a/src/core/taction.h b/src/core/taction.h index f55d48504..d20093a6a 100644 --- a/src/core/taction.h +++ b/src/core/taction.h @@ -19,9 +19,10 @@ #ifndef TACTION_H #define TACTION_H +#include "nootkacoreglobal.h" #include <QtCore/qobject.h> #include <QtGui/qcolor.h> -#include <nootkacoreglobal.h> +#include <QtQml/qqmlregistration.h> class QQmlComponent; @@ -35,6 +36,7 @@ class QQmlComponent; class NOOTKACORE_EXPORT Taction : public QObject { Q_OBJECT + QML_ELEMENT Q_PROPERTY(QString icon READ icon WRITE setIconTag NOTIFY iconChanged) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) diff --git a/src/core/tnootkaqml.cpp b/src/core/tnootkaqml.cpp index 0df1122f2..6593afed5 100644 --- a/src/core/tnootkaqml.cpp +++ b/src/core/tnootkaqml.cpp @@ -79,7 +79,6 @@ TnootkaQML::TnootkaQML(QObject *parent) qmlRegisterType<TpianoBg>("Nootka", 1, 0, "TpianoBg"); qmlRegisterType<TbandoneonBg>("Nootka", 1, 0, "TbandoneonBg"); qmlRegisterType<TsaxBg>("Nootka", 1, 0, "TsaxBg"); - qmlRegisterType<Taction>("Nootka", 1, 0, "Taction"); qmlRegisterUncreatableType<TnootkaQML>("Nootka", 1, 0, "Nootka", QStringLiteral("You cannot create an instance of the TnootkaQML.")); qmlRegisterType<TtuneObject>("Nootka", 1, 0, "TtuneObject"); diff --git a/src/qml/+android/FlyItem.qml b/src/qml/+android/FlyItem.qml index 77d0bd385..88cb7bd4f 100644 --- a/src/qml/+android/FlyItem.qml +++ b/src/qml/+android/FlyItem.qml @@ -3,6 +3,7 @@ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ import Nootka 1.0 +import Nootka.Music import QtQuick 2.12 import QtQuick.Controls 2.12 diff --git a/src/qml/+android/MainMenuMobile.qml b/src/qml/+android/MainMenuMobile.qml index 9bd025e32..5e1632034 100644 --- a/src/qml/+android/MainMenuMobile.qml +++ b/src/qml/+android/MainMenuMobile.qml @@ -3,6 +3,7 @@ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ import Nootka 1.0 +import Nootka.Music import Qt5Compat.GraphicalEffects import QtQuick 2.12 import QtQuick.Controls 2.12 diff --git a/src/qml/+android/shared/MenuButton.qml b/src/qml/+android/shared/MenuButton.qml index f174d20e4..089538e83 100644 --- a/src/qml/+android/shared/MenuButton.qml +++ b/src/qml/+android/shared/MenuButton.qml @@ -4,7 +4,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 - +import Nootka.Music import Nootka 1.0 diff --git a/src/qml/about/HelpPage.qml b/src/qml/about/HelpPage.qml index bb122ec47..d3b0a08b6 100644 --- a/src/qml/about/HelpPage.qml +++ b/src/qml/about/HelpPage.qml @@ -4,6 +4,7 @@ import "../" import Nootka 1.0 +import Nootka.Music import QtQuick 2.12 import QtQuick.Controls 2.12 diff --git a/src/qml/shared/HeadButton.qml b/src/qml/shared/HeadButton.qml index d771b167e..5c1334e17 100644 --- a/src/qml/shared/HeadButton.qml +++ b/src/qml/shared/HeadButton.qml @@ -3,6 +3,7 @@ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ import Nootka 1.0 +import Nootka.Music import QtQuick 2.12 import QtQuick.Controls 2.12 diff --git a/src/qml/shared/MenuButton.qml b/src/qml/shared/MenuButton.qml index e478c9c3c..a2a1e46cc 100644 --- a/src/qml/shared/MenuButton.qml +++ b/src/qml/shared/MenuButton.qml @@ -3,6 +3,7 @@ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ import Nootka 1.0 +import Nootka.Music import QtQuick 2.12 import QtQuick.Controls 2.12 -- GitLab