11

I want to insert QQuickView to my old qt4 application in some widget layout. How to mix QWidget and QWindow in a single application?

Are there any examples?

EgorBo
  • 6,120
  • 3
  • 35
  • 40
DEgITx
  • 960
  • 1
  • 13
  • 24

2 Answers2

8

This has been fixed in Qt 5.1. Citing [1]

To remedy this problem, Qt 5.1 introduces the function QWidget::createWindowContainer(). A function that creates a QWidget wrapper for an existing QWindow, allowing it to live inside a QWidget-based application. Using QQuickView or QOpenGLContext together with widgets is now possible.

[1] https://www.qt.io/blog/2013/02/19/introducing-qwidgetcreatewindowcontainer

kfunk
  • 2,002
  • 17
  • 25
  • 1
    the [1] link is broken, the new url is https://blog.qt.io/blog/2013/02/19/introducing-qwidgetcreatewindowcontainer/ – Aerthel Aug 17 '19 at 22:14
2

Found this issue on Qt-project bugtracker.

There is some workarounds in comments.

p.i.g.
  • 2,815
  • 2
  • 24
  • 41
Nightmare
  • 63
  • 1
  • 7
  • Although your answer is 100% correct, it might also become 100% useless if that link is moved, changed, merged into another one or the main site just disappears... **:-(** Therefore, please [edit] your answer, and copy the relevant steps from the link into your answer, thereby guaranteeing your answer for 100% of the lifetime of this site! **;-)** You can always leave the link in at the bottom of your answer as a source for your material... – Donald Duck Feb 24 '17 at 14:58