Qt 5.4 QVariant change and module news

Timo Jyrinki timo.jyrinki at canonical.com
Tue Feb 17 07:37:38 UTC 2015


Qt 5.4 is now in vivid, powering Ubuntu Phone starting with devel
image #102, Kubuntu's Plasma 5 and also the Unity 8 desktop preview.
No app changes are generally needed, but there is a change in QVariant
that may be relevant to C++ using apps.

== QVariant change in Qt 5.4 ==

QVariant has changed a bit in Qt 5.4, although in a way that fixing
its use does not affect negatively use in Qt 5.3 either.

Quote: ”When a JavaScript object/array is passed to C++ through a
QVariant, the engine no longer immediately converts the object
recursively into a QVariantMap or QVariantList but instead stores a
QJSValue in the QVariant. This prevents a loss of data when the JS
object contains non-primitive types such as function objects for
example. Code that expects the variant type to be exactly
QVariant::Map or QVariant::List may need to be adapted. Registered
conversion functions however ensure that code that merely calls
toMap() or toList() continues to work.” [QTBUG-40431]

Examples of fixes:
- Oxide: https://code.launchpad.net/~aacid/oxide/qt54_variantjs/+merge/248765
- Ubuntu UI Toolkit:
https://code.launchpad.net/~aacid/ubuntu-ui-toolkit/statesaver_54/+merge/247986

Another noted small difference:
”In Qt 5.4 an alias to a null variable is correctly null instead of
undefined like it was in Qt 5.3”

== Status of less supported Qt modules ==

It's useful to remember that not all of Qt we have in Ubuntu is
supported by the Qt Project:

- qtlocation: Upstream releases this as part of their releases, but
they emphasize that Qt Positioning is API stable while Qt Location
might change. Still, this should be pretty safe to use and will
probably be declared stable soon.
- qt3d: The original module has not been developed for two years. A
complete rewrite has been in development during that time. Qt 3D 2.0
will be available as a preview with Qt 5.5.
- qtsystems: Semi-active development. Qt 5.4 absorbed QStorageInfo to
be official part of qtbase, but it is a bit different and oddly does
not have QML support at this point. We include the SystemInfo module
on the phone images, but currently not the Publish Subscribe or
Service Framework modules from the same source.
- qtpim: Semi-active development, but can be considered supported
since our Renato is one of the upstream developers. Ubuntu uses the
Contacts/Organizer extensively in phone/scheduling apps.
- qtfeedback: Stable in the sense that there is no development
happening. It's also a very small module. If you are interested in the
module, consider taking an active role in the Qt Project where
contributions would surely be welcome.

-Timo



More information about the ubuntu-devel mailing list