[Qt-qml] Dummy modules

warwick.allison at nokia.com warwick.allison at nokia.com
Fri Jul 23 03:35:17 CEST 2010


> I agree, but I thought that a plugin would only make the C++ objects
> visible to the QML, (i.e. when run from qmlviewer).

Modules (the things imported by the import <uri> syntax) can include both QML files and C++ plugins to provide new types.

> My concern/question was specifically: How to *display* a regular Qt (i.e. non-qml) widget
> (namely, my QCalendarWidget) inside my QML components: I originally
> though that this wasn't possible...
> 
> However, now that I've been looking more into this, I realize that
> http://doc.qt.nokia.com/main-snapshot/qml-integration.html#loading-
> qgraphicswidget-objects-in-qml
> tells us how to include a QGraphicsWidget inside a QML component. So I
> guess that I could embed my QCalendarWidget inside a QGraphicsWidget
> and add the QGraphicsWidget to QML. Is that what you would recommand ?

Yes, you can do that.

Personally, I think it would be easier to just make a QML calendar element purely in QML, but aside from performance the above certainly works, and maybe you'd have to write so much JS that the QML one wouldn't perform well enough either (though then I'd still recommend ripping the internals out of QCalendarWidget and making a QDeclarativeItem subclass).

--
Warwick




More information about the Qt-qml mailing list