Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

QQuickWindow not shown

$
0
0
Hello, I am testing stuff but I just can’t be able to understand why the following code does not work: int main(int argc, char *argv[]) {     QGuiApplication app(argc, argv);           QQmlEngine engine;     //The QQmlComponent class encapsulates a QML component definition     QQmlComponent component( &engine, QUrl::fromLocalFile("qml/myTEst/main.qml"));       //Create an object instance from this component     QObject* myComponent = component.create();       QQuickWindow*  window = qobject_cast<QQuickWindow *>(myComponent);     window->show();       return app.exec(); } In the end when I try to run no window is displayed and the App. exits with: “The program has unexpectedly finished app.exe exited with code -1073741819” Don’t know what I am doing wrong.

Viewing all articles
Browse latest Browse all 4972

Trending Articles