[Development] [QtQuick] Adaptable UI Sessions from Qt CS
416365416c at gmail.com
Wed Jul 24 17:43:54 CEST 2013
General agreement was had on the three main parts of an adaptable UI
1. assets:// . A new assets directory will be added to QStandardPaths
and assets:// will point to that, except on Android. On Android assets
will be Android assets. QRC is still recommended for cross-platform
deployment, but when you want them deployed as separate files
assets:// will be a cross-platform way to achieve that. Like qrc:///,
there will be special handling by QFile.
2. File Selectors. Primarily for use in QML, they are a standard
mechanism for how to subsitute different files under different
circumstances. The selectors available by default will be platform,
and form factor or input selectors if we can reliably figure them out
in time. Those selectors may not make the initial release. Generic
ways of setting selectors will, so that individual platforms can set
their own selectors (they tend to have much greater knowledge about
both how the device is used and what selectors are appropriate).
This way you can have
instead of necessarily juggling qrc files.
During the QtCS discussions it was determined that dynamically
swapping at runtime will not be initially supported. Selectors are
only applied when QML files are loaded.
File selectors are not a built-in feature of the language. They will
be enabled by default on QQmlApplicationEngine through the new
QQmlAbstractUrlInterceptor functionality. Singleton types are being
added as a built-in feature of the language, they will allow a better
means of specifying selected contents compared to "settings.js".
I aim to be implementing all of this by 5.2, as much of the work was
already done for 5.1 already. See
https://codereview.qt-project.org/#change,48334 , which has the
discussed functionality plus an attempt at adding form factor
selectors. Those will probably be dropped soon unless anyone has a
better idea on how to implement it.
3. Bindings. Screen attached object has resolution, for example, and
for repsonding to runtime changes across continuous variables, like
window size, screen size and resolution, you should bind to
appropriate values. This is similar to the Ubuntu grid unit concept,
and works well in conjunction with layouts.
Also touched on was that some platform settings, like
doubleClickInterval and pressAndHoldDelay, should be added to the
Qt.application object. Ideally this would involve moving them down to
QGuiApplication from QApplication.
More information about the Development