Unsolved After Qt>=5.9, QWidget addWidget QML ApplicationWindow can cause interface drift. Does anyone know how to solve this problem?
-
-
@WoHowLearn
like Ulf Hermann said, use a pure QQuickWidget it should solve the issue for your case -
@J-Hilk
It does not working. QWidget cannot addwidgetQML Application
.
Like this :
-
@WoHowLearn did you add
QT += quickwidgets
to your project file ? And QQuickWidgets was not imported, as far as I can tell -
The program can run,
but there is no way to embed a qquickwidget into a qwidget ,
because the root of QML isApplicationWindow
.So that's the only way I can do it.
-
@WoHowLearn said in After Qt>=5.9, QWidget addWidget QML ApplicationWindow can cause interface drift. Does anyone know how to solve this problem?:
ApplicationWindow
ok, fair enough, what feature of ApplicationWindow is important for you, that you couldn't replace the rootItem with, say a Rectangle?
-
@J-Hilk
I haven't tried substitution.
But as the QTBUG-67698 last comment says , the exact same code works fine until qt<5.9.