Qt-contributors-summit-2013-Evolution-of-the-QML-language
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
Forward Versioning Control
Uses Qt versions, meaning no new features in patch releases.
For features that won't provide good errors, consider using pragmas to enforce a clear error message at the top of the files
Impending Features
Targeting 5.2
Pragmas
new "pragma foo" lines will be added. pragma lines must come in the preamble before all item declarations, and some might require being placed before import lines. Note that unlike QML/JS files, there is no "." before the line. Example:
- pragma strict
- import QtQuick 3.3
- Item {
- property var foo: "Alpha"
- }
Singletons
New "pragma singleton" makes this QML file represent a type which is a singleton type. Behavior of type is identical to C++/JSValue singletons.
Example:
- pragma singleton
- import QtQml 2.0
- //OtherType.qml
- QtObject {
- property int foo: 3
- }
- import QtQuick 2.2
- import "."
- Item {
- width: 20 + OtherType.foo
- }
Long term features
No schedule yet. Note that attached properties are currently planned to be left with C++ as an advanced usecase.
Enums in QML
Something like
- property enum orderOptions: [ OrderByType, OrderByHeight, OrderByMagic ]
Grouped properties in QML
Something like
- property group<CustomObject> foo { weight: 300; height: 200; }
Where CustomObject is a QObject derived type, and the non-optional initializer provides a default value which is copied on write.
const properties
- property const int offsetter: 20
pragma strict
Mostly like JS pragma strict, may provide even more type safety by denying implicit conversions (if we add explicit conversions of course).