[Development] QML Runtime

Kevin Krammer kevin.krammer at kdab.com
Tue Dec 11 12:15:04 CET 2012


On Tuesday, 2012-12-11, Knoll Lars wrote:
> On Dec 11, 2012, at 10:47 AM, Kevin Krammer <kevin.krammer at kdab.com>
> 
>  wrote:
> > On Tuesday, 2012-12-11, Alan Alpert wrote:

> >> One big difference would be less flexibility about the invocation. As
> >> a debugging tool qmlscene needs to be able to run smaller "units" of
> >> QML to simplify debugging, that's why it just puts the top-level item
> >> into a QQuickView. While that works for a lot of cases, it's not
> >> really application behavior. qml should leave the window entirely up
> >> to the application, meaning that the root item of any GUI application
> >> would be a Window{} or similar. Note that this restriction would never
> >> fly in qmlscene, because qmlscene needs to be able to run the
> >> components of an application (like the inside of your Button.qml) to
> >> debug and test them in isolation. This additionally gives the
> >> advantage of no excess QQuickView when running a non-gui QML app
> >> (which isn't really an issue for debugging, but sucks for deployment).
> > 
> > The main difficulty I see is how to determine which application class to
> > instantiate.
> > 
> > If you load a non-UI QML file you might not want QGuiApplication to be
> > instantiated.
> > If you load a QtQuick1 file you'll need QApplication instantiated.
> 
> I'd assume that the runtime will be limited to Qt Quick 2.

Ah, pity :-/
I was hoping for a generic QML runtime :)

> > If you load a BB10 Cascades application you'll need a
> > bb::cascades::Application (which is a direct subclass of
> > QCoreApplication) instantiated.
> 
> Yikes. Do you really need a different Application type for Cascades? That's
> pretty bad IMO.

KDE has been doing that for years as well and I've seen it in customer 
projects also.

I guess subclassing and putting your init code into your constructor and your 
shutdown code into your destructur is just the most obvious thing to do to the 
common C++ developer.

It could also hint that qt_startup_hook and qAddPostRoutine are not as well 
documented as they could be.

Cheers,
Kevin
-- 
** Qt Developer Conference: http://qtconference.kdab.com/ **

Kevin Krammer | kevin.krammer at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4712 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121211/e6e7555c/attachment.bin>


More information about the Development mailing list