Unsolved Integration C++/QML
-
I have a GUI project with several sub-projects, that is a very extensive directories of tree. Many sub-projects are GUI plugins. I am wanting to make a sub-project with QML, or want to migrate GUI for QML. When I call the QML, my QML screen appears:
engine.addImportPath("/home/mhaylson/m2smart/dsm/src/module"); qDebug() << engine.importPathList(); component = new QQmlComponent(&engine, QUrl("qrc:/cashierqml/imports/CashierQml/CashierNfce.qml")); if (component->isLoading()) QObject::connect(component, SIGNAL(statusChanged(QQmlComponent::Status)), this, SLOT(continueLoading())); else continueLoading(); if (component->isError()) { qWarning() << component->errors(); } else { QObject *myObject = component->create(); QObject::connect(myObject, SIGNAL(signalShowMessag(QString)), this, SLOT(showMessa(QString))); }
But my QML screen "freezes", or click on a button or try to do some interaction or action and nothing happens. I did QML screen test on a new project and it worked properly.
int main(int argc, char *argv[]) { QApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/cashierqml/imports/CashierQml/CashierNfce.qml"))); return app.exec(); }
Why that?