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?
Layouts can be applied on QWidgets only. What you have to do is to insert a widget and apply the new layout to the widget. Tab widgets can contain the layout to align all items in it.
Add at least one widget on your MainWindow . Then select your window by clicking on it and click on the VerticalLayout Button at the top of QTCreator . You Vertical Layout is automatically added to the central widget and fills all the surface.
Let's open up Designer by double-clicking the mainwindow. ui to put menu bar and action. Type in "File" at the top menu, and "New Window..." under the "File" menu. We need to press Enter to make a real change in the menu.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With