Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Release version not working when using Window instead of Rectangle as top element
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bidochon
    wrote on last edited by
    #1

    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
    folder_01.target = qml
    DEPLOYMENTFOLDERS = folder_01

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

    QML_IMPORT_PATH =

    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.

    include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
    qtcAddDeployment()
    @

    Thanks for any help.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ledunkang
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bidochon
        wrote on last edited by
        #3

        Here are my include in the main.cpp file

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

        1 Reply Last reply
        0
        • L Offline
          L Offline
          ledunkang
          wrote on last edited by
          #4

          '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();
          }@

          1 Reply Last reply
          0
          • L Offline
            L Offline
            ledunkang
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved