[SOLVED] Embed qwidget in QML
-
wrote on 18 Jul 2011, 20:47 last edited by
Hello everyone,
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.Best regards
Raivis. -
wrote on 18 Jul 2011, 20:58 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 -
wrote on 19 Jul 2011, 19:17 last edited by
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?
-
wrote on 19 Jul 2011, 19:34 last edited by
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?
-
wrote on 20 Jul 2011, 17:45 last edited by
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");
-
wrote on 8 Feb 2012, 08:41 last edited by
But the PieChart derives from "QDeclarativeItem", which is not a real widget, how can I embeded a QWidget in my qml?
-
wrote on 8 Feb 2012, 12:11 last edited by
Hi,
see "this tutorial":http://developer.qt.nokia.com/doc/qt-4.8/declarative-cppextensions-qwidgets.html
-
wrote on 23 Oct 2014, 14:07 last edited by
Since QDeclarative is marked as deprecated in Qt5 you can use QQuickPaintedItem to draw QWidgets in QML.