I have described the question in detail in stack overflow:
http://stackoverflow.com/questions/16066428/qt5-0-2-qtquick2-0-c-what-is-the-right-way-to-make-a-class-outside-main-cp
The problem:
=============================================
I want to make a C++ application that uses QML for dialog UI.
I am trying to put my UI code outside main.cpp (in a class called “Dialog”), so that I can later separate it to run in a thread.
I build & run: No errors in compilation, no errors in application output.
However, nothing shows up on the screen. But if written in main.cpp, this chunk of code shows the QML dialog correctly:
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/Kiosk/main.qml"));
viewer.showExpanded();
==========================================================
I wonder why this is happening, could you please advise – what am I doing wrong?
↧