[Qt5-feedback] QML-related wishlist
Alan Alpert
alan.alpert at nokia.com
Thu May 12 06:13:39 CEST 2011
On Thu, 12 May 2011 10:41:03 ext Jason Kinzer wrote:
> 1 - Reduce QML memory overhead (important)
>
> I would like to see this replace most of my uses for QGV. However, an issue
> I have is that QObject is pretty fat, and QDeclarativeItem even more so.
> In the cases for QGV where today I have huge numbers of items I can always
> use the non QObject-based subclasses. For QML however, I appear to be
> stuck. It would be wonderful if the declarative item could be refactored a
> la' QGV into a lighter-weight base class that can be used if no events are
> required, and heavier ones based on QObject otherwise. (And yeah, I know
> the initial use-cases for QML specifically talked about reducing the item
> counts, but as we're talking about ideally moving entirely to a QML-based
> frontend, I echo comments some others have noted: let's see the 'chips'
> example in QML!).
The 40000 chips example perfectly matches the design goals of Graphics View.
It has multiple views, a vast number of static objects, and limited
interactivity - but you'll note that most of the UI is still implemented with
QWidgets. QML has significantly different design goals: single views, a moderate
number of dynamic and animated objects, and it is the UI part of the
application. The way I envisage creating the 40000 chips example in Qt5 would
be to still use Graphics View for the chips part, you're just using QML for
the UI around it instead of QWidgets (although you could still do it with
QWidgets just fine, as long as you didn't want to permeate it with animations
or run it on a mobile device).
QML memory overhead is likely to go down a little, just because it's always
good to optimize performance. But I would not want to see it try to replace
Graphics View for the use-case of thousands of unanimated items. It is only in
that use-case where it's worth shaving off the QObject memory cost. Remember
that you can (or should be able to in an idealized world) place a Graphics
View inside a QML UI. Graphics View would only be obsoleted for the use-case
of fluid UIs, where it never really took off (without QML) anyways.
--
Alan Alpert
More information about the Qt5-feedback
mailing list