Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QQuickView problems
Qt 6.11 is out! See what's new in the release blog

QQuickView problems

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 9.1k Views
  • 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.
  • OllieO Offline
    OllieO Offline
    Ollie
    wrote on last edited by
    #1

    wrote a minimal qquick app and I'm getting an error in the debug stream

    "QQuickView does not support using windows as a root item.
    If you wish to create your root window from QML, consider using QQmlApplicationEngine instead."

    Also when I don't call qqv.show() the form displays anyway. If I do call show() a second empty window pops up.
    Code attached. Running on Windows 10 and developed using Visual Studio comunity 2015.

    #include <QtWidgets/QApplication>
    #include <QtQuick/QQuickView>

    int main(int argc, char * argv[])
    {

    QApplication app(argc, argv);
    QQuickView qqv;
    qqv.setResizeMode(QQuickView::SizeRootObjectToView);	
    qqv.setSource(QUrl("qrc:/main.qml"));
    // qqv.show();
        return app.exec();
    

    }

    Thanks
    O.

    1 Reply Last reply
    1
    • D Offline
      D Offline
      Devopia53
      wrote on last edited by
      #2

      It is warning of a window object in main.qml and QQuickView are duplicated.
      You should be delete window QML object in main.qml.

      ex)

      import QtQuick 2.4
      import QtQuick.Window 2.2
      
      //Window {
      //    visible: true
      
          MainForm {
              anchors.fill: parent
              mouseArea.onClicked: {
                  Qt.quit();
              }
          }
      //}
      
      OllieO 1 Reply Last reply
      1
      • D Devopia53

        It is warning of a window object in main.qml and QQuickView are duplicated.
        You should be delete window QML object in main.qml.

        ex)

        import QtQuick 2.4
        import QtQuick.Window 2.2
        
        //Window {
        //    visible: true
        
            MainForm {
                anchors.fill: parent
                mouseArea.onClicked: {
                    Qt.quit();
                }
            }
        //}
        
        OllieO Offline
        OllieO Offline
        Ollie
        wrote on last edited by
        #3

        @Devopia53 Fixed! thanks.

        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