Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] Embed qwidget in QML
Is it possible to embed QWidget in QML design?
That would be awesome, because I need this HWND Id for mplayer library.
I already know how to implement the other way, QML in QWidget.
I would like to do some animations with QWidget, more specifically flip animation.
DenisKormalev last edited by
Try to use search on DevNet. This problem was raised couple of times.
As a quick answer look "here":http://doc.qt.nokia.com/4.7/declarative-cppextensions-qwidgets.html
Thanks for reply,
However, I'm doing something wrong. Because, I get this when I try to launch my app @file:///home/user/Desktop/Bizness/simple_gui/myqml.qml:2:1: module "qmlam" plugin "qmlqwidgetsplugin" not found import "qmlam" 1.0 ^ @
Should I include something more in the pro file, or I have to install some kind of plugin?
Without knowing what you're doing, it's hard to tell. The example that Denis pointed to creates a plugin which has the embedded widget in it.
How are you trying to integrate your widget into your app?
Do you have any minimal example code?
Okay, I found another example, I believe a bit better to understand this QWidget embedding!
"Here is the other example":http://doc.qt.nokia.com/4.7-snapshot/declarative-tutorials-extending-chapter1-basics.html
Oh and I know what didn't do I never registered my class for QML to use.
qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
renyt last edited by
But the PieChart derives from "QDeclarativeItem", which is not a real widget, how can I embeded a QWidget in my qml?
task_struct last edited by
see "this tutorial":http://developer.qt.nokia.com/doc/qt-4.8/declarative-cppextensions-qwidgets.html
froncer last edited by
Since QDeclarative is marked as deprecated in Qt5 you can use QQuickPaintedItem to draw QWidgets in QML.