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. Embed qwidget in QML.

Embed qwidget in QML.

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.1k 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.
  • F Offline
    F Offline
    Feanoreal
    wrote on last edited by
    #1

    Hello!

    I have my own widget, where I reimplemented paintEvent, mouseMoveEvent and etc, "here":http://qt-project.org/forums/viewthread/7893 is the answer to my question for Qt 4.7, but what is the way to embed qwidget in QtQuick 2 (Qt 5.1)?

    Thanks.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      There is no official way to embed QWidget in QML right now. The best way is to port the widget to a QQuickPaintedItem or use Qt Quick Controls to replace widget functionality in your application.

      There is however a way to embed Qt Quick inside a widget by means of QWidget::createWindowContainer

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aptyp
        wrote on last edited by
        #3

        Hello, Jens. Reading docs I've found that we can reimplement updatePaintNode function too. Isn't that approach is better?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jens
          wrote on last edited by
          #4

          That depends on your use case. If you are showing pure 3d geometry then yes, but most normal widgets are a lot easier to port by using QQuickPaintedItem.

          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