Release version not working when using Window instead of Rectangle as top element

  • I had some issues running my application until I decided to try to use Rectangle as top element (instead of Window).

    Do I need to add something to my .pro file to make it work with Window

    Here is my .pro so far


    Add more folders to ship with the application, here

    folder_01.source = qml/octopusTutorial = qml

    Additional import path used to resolve QML modules in Creator's code model


    The .cpp file which was generated for your project. Feel free to hack it.

    SOURCES += main.cpp

    Installation path

    target.path =

    Please do not modify the following two lines. Required for deployment.


    Thanks for any help.

  • which class do you use, qquickview or qqml...engine, in main.cpp?
    check docs of ApplicationWindow.

  • Here are my include in the main.cpp file

    #include <QtGui/QGuiApplication>
    #include "qtquick2applicationviewer.h"
    #include <QWindow>

  • 'With Qt Quick Controls, declare an ApplicationWindow as the root item of your application and launch it by using the QQmlApplicationEngine instead'
    @#include <QApplication>
    #include <QQmlApplicationEngine>

    int main(int argc, char *argv[])
    QApplication app(argc, argv);
    QQmlApplicationEngine engine("main.qml");
    return app.exec();

  • make sure the visible property be true,and not all qquick control works in normal itemsuch as Rectangle.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.