Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Add QQuickView to QWidget

    QML and Qt Quick
    5
    7
    6481
    Loading More Posts
    • 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.
    • S
      sikander243 last edited by

      Hi Everyone
      I want to add a custom list view to my existing UI project, I read this article, but I think it needs an update now.

      http://doc.qt.digia.com/4.7-snapshot/qml-integration.html

      I am getting following error if I do it with Qt 5.0 Qt Creator 2.6.1
      error: C2664: 'QBoxLayout::addWidget' : cannot convert parameter 1 from 'QQuickView' to 'QWidget *'
      No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

      any pointers how I would be able to perform this.

      1 Reply Last reply Reply Quote 0
      • J
        Jens last edited by

        I am afraid this is somewhat complicated in Qt5 and not even possible in 5.0. The main reason is that QQuickView is no longer a widget but a QWindow. With 5.0 there is no simple solution, but in Qt 5.1 we have added a new function QWidget::createWindowContainer which you can use to embed a QQuickView in a QWidget layout like you are trying to do. For Qt 5.0 the only solution is to use the QQuick1 module and associative QDeclarativeView classes which you were using in Qt4.

        1 Reply Last reply Reply Quote 0
        • A
          alizadeh91 last edited by

          QQuickView is child of QWindow(a top level window) and can't add to qwidget as before. See this:
          https://bugreports.qt-project.org/browse/QTBUG-25643

          1 Reply Last reply Reply Quote 0
          • S
            sikander243 last edited by

            well I switched to qt 4.8 and it seems to work nice now all I needed was to have a Custom List View ontop of my chatting application, and I have tested by putting in a qml object now shall be moving towards learning qml to build a custom listview.

            thanks by the way how to mark this solved.

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User last edited by

              [quote author="Jens" date="1361292785"]I am afraid this is somewhat complicated in Qt5 and not even possible in 5.0. The main reason is that QQuickView is no longer a widget but a QWindow. With 5.0 there is no simple solution, but in Qt 5.1 we have added a new function QWidget::createWindowContainer which you can use to embed a QQuickView in a QWidget layout like you are trying to do. For Qt 5.0 the only solution is to use the QQuick1 module and associative QDeclarativeView classes which you were using in Qt4.[/quote]

              Very good solution. But i have a suggestion that, it will be nice if Qt team can provide a similar solution like QDeclarativeView.

              1 Reply Last reply Reply Quote 0
              • JKSH
                JKSH Moderators last edited by

                [quote author="ansifpi" date="1393569020"]i have a suggestion that, it will be nice if Qt team can provide a similar solution like QDeclarativeView.[/quote]Qt 5.3 will have QQuickWidget

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply Reply Quote 0
                • J
                  Jens last edited by

                  ansifpi: QDeclarativeView in Qt Quick 1.x is already a widget so no need to embed in a window container there.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post