[Qt-qml] (newbie) how can I use my C++ widget in QML?
Eduardo Fleury
eduardo.fleury at openbossa.org
Wed Oct 6 11:25:13 CEST 2010
Hi there!
On Wed, Oct 6, 2010 at 6:01 AM, Raymond de Vries <reedev at xs4all.nl> wrote:
> I have been creating applications with the C++ API and have some custom
> widgets, e.g. for OpenGL rendering. Now I would like to use these
> widgets in my QML based UI application.
Which kind of widgets are these? QGraphicsWidgets? QWidgets?
QML scene is a QGraphicsItem scene, so you are able to add QGraphicsWidgets
to it. I'm not much into that but my understanding is that you must ensure
your widgets have a default constructor (there's no way to give constructors
parameters within QML) and then you must register your class
(qmlRegisterType) so it is visible in QML.
There must be something about that in the docs, check for qmlRegisterType.
--
Eduardo M. Fleury
OpenBossa - INdT
http://eduardofleury.com/
http://www.openbossa.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101006/087074c9/attachment.html
More information about the Qt-qml
mailing list