Skip to content
Snippets Groups Projects
Commit 047bbb95 authored by SeeLook's avatar SeeLook
Browse files

TnootkaQML keeps QML engine set in main

parent c776237c
No related branches found
No related tags found
No related merge requests found
......@@ -431,6 +431,11 @@ qreal TnootkaQML::bound(qreal min, qreal val, qreal max) {
}
void TnootkaQML::setQmlEngine(QQmlEngine* e) {
m_qmlEngine = e;
}
//#################################################################################################
//################### CONNECTIONS NODE ############################################
//#################################################################################################
......
......@@ -33,6 +33,7 @@
class TcommonInstrument;
class TscoreObject;
class QQuickItem;
class QQmlEngine;
#define NOO TnootkaQML::instance()
......@@ -125,7 +126,9 @@ public:
Q_INVOKABLE QString pixToHtml(const QString& pixName, int height = 0);
/** Calls @p QDesktopServices::openUrl with Nootka site doc at given @p hash */
/**
* Calls @p QDesktopServices::openUrl with Nootka site doc at given @p hash
*/
Q_INVOKABLE void openHelpLink(const QString& hash);
Q_INVOKABLE qreal bound(qreal min, qreal val, qreal max);
......@@ -133,6 +136,12 @@ public:
bool resetConfig() const { return m_resetConfig; }
Q_INVOKABLE void setResetConfig(bool rc) { m_resetConfig = rc; }
/**
* Main @p QQmlEngine created at very beginning of Nootka launch
*/
QQmlEngine* qmlEngine() { return m_qmlEngine; }
void setQmlEngine(QQmlEngine* e);
/**
* All stuff below is responsible for handling note changes in score, instrument and sound in/out.
* @p TnootkaQML has score and instrument pointers to handle theirs signals when note is changed,
......@@ -191,6 +200,7 @@ private:
bool m_nodeConnected = false;
bool m_ignoreScore = false; /**< Becomes @p TRUE to ignore @p scoreChangedNote() slot */
bool m_resetConfig = false;
QQmlEngine *m_qmlEngine = nullptr;
};
#endif // TNOOTKAQML_H
......@@ -134,6 +134,7 @@ int main(int argc, char *argv[])
e->rootContext()->setContextProperty(QStringLiteral("Noo"), &nooObj);
e->rootContext()->setContextProperty(QStringLiteral("SOUND"), &sound);
if (GLOB->isFirstRun) {
nooObj.setQmlEngine(e);
e->load(QUrl(QStringLiteral("qrc:/wizard/Wizard.qml")));
exitCode = a->exec();
delete e;
......@@ -143,6 +144,7 @@ int main(int argc, char *argv[])
e->rootContext()->setContextProperty(QStringLiteral("SOUND"), &sound);
GLOB->isFirstRun = false;
}
nooObj.setQmlEngine(e);
qmlRegisterType<TnameItem>("Nootka.Main", 1, 0, "TnameItem");
qmlRegisterType<TmainScoreObject>("Nootka.Main", 1, 0, "TmainScoreObject");
qmlRegisterType<TdialogLoaderObject>("Nootka.Dialogs", 1, 0, "TdialogObject");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment