Hello friends,

I have expose one c++ classes to qml in a main.cpp file like this:

Qt Code:
  1. int main(int argc, char** argv)
  2. {
  3. QGuiApplication app(argc, argv);
  4.  
  5.  
  6. qmlRegisterType<MyTestClass>("Test", 1, 0, "Test");
  7.  
  8.  
  9. QQuickView view;
  10. view.resize(800, 480);
  11. view.setResizeMode(QQuickView::SizeRootObjectToView);
  12. view.setSource(QUrl("qrc:///main.qml"));
  13. view.show();
  14. return app.exec();
  15. }
To copy to clipboard, switch view to plain text mode 

But my root object in qml is a ApplicationWindow object. So I get a
QQuickView only supports loading of root objects that derive from QQuickItem.
So when I avoid the main.cpp I have to run the qml file with qmlscene. But I want to have an exe file. How can I use an main.cpp in combinatiion with a ApplicationWindow root object in a qml file?

Yours,