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. Add QQuickView to QWidget
Forum Updated to NodeBB v4.3 + New Features

Add QQuickView to QWidget

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 5 Posters 7.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.
  • S Offline
    S Offline
    sikander243
    wrote on 19 Feb 2013, 14:44 last edited by
    #1

    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
    0
    • J Offline
      J Offline
      Jens
      wrote on 19 Feb 2013, 16:53 last edited by
      #2

      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
      0
      • A Offline
        A Offline
        alizadeh91
        wrote on 20 Feb 2013, 08:32 last edited by
        #3

        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
        0
        • S Offline
          S Offline
          sikander243
          wrote on 20 Feb 2013, 09:05 last edited by
          #4

          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
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on 28 Feb 2014, 06:30 last edited by
            #5

            [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
            0
            • J Offline
              J Offline
              JKSH
              Moderators
              wrote on 28 Feb 2014, 14:31 last edited by
              #6

              [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
              0
              • J Offline
                J Offline
                Jens
                wrote on 28 Feb 2014, 15:05 last edited by
                #7

                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
                0

                • Login

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