Details
-
Sub-task
-
Resolution: Done
-
P0: Blocker
-
6c77950e991d8152a9f1221e57c68c6d48dbfc7f
Description
Overview
We have an immediate need to introduce new properties to existing QML items (QTBUG-13512, QTBUG-7300). We want to ensure that these properties are only available if the correct import is used.
The following should fail:
import Qt 4.7 Item { newPropertyFor48: "myValue" }
while the following should succeed
import Qt 4.8 Item { newPropertyFor48: "myValue" }
We also need versioning for other things exposed to QML – signals, slots, and Q_INVOKABLEs.
Reasoning
QML is slightly different to C++. In C++ adding a new method or property cannot break old applications, whereas in QML as an object's properties can appear in a scope chain it can change what a name resolves to.
For example, consider these two QML files
main.qml
=======
import Qt 4.7
Item {
id: root
MyComponent {}
}
MyComponent.qml
==============
import MyModule 1.0
CppItem {
value: root.x
}
where CppItem maps to the C++ class QCppItem. If, in a new version of their module, the author of QCppItem adds a "root" property to QCppItem it will break my program. Our solution is to allow the author of QCppItem to say that the new root property is in revision 2 of QCppItem and QML will make sure that it is only accessible if you "import MyModule 1.1". In this way we can permit new properties and features to be added to existing QML elements while not breaking existing programs.
Who needs it
This is important for QML itself. QML is currently tied to Qt releases via the import Qt 4.7 module. In order to allow progress in the QML core elements we must decouple the QML elements from minor Qt releases. This allows us to react to stakeholder requirements and address our oversights in a reasonable timeframe. Once the enablers are in place, the QML core elements should have their own module name. The current proposal is to use import QtQuick 1.0 starting with Qt 4.7.1. Note that import Qt 4.7 will continue to work.
This will also be needed for other modules such as Qt Components and Qt Mobility. Since these are based on Qt 4.7 we must ensure that this is available in Qt 4.7.1.
Attachments
Issue Links
- is required for
-
QTBUG-15878 Add mirror property to Image, BorderImage and AnimatedImage elements
- Closed
-
QTBUG-13087 Should be able to delay binding evaluation for dynamically created objects
- Closed
-
QTBUG-13512 WebView has no way of jumping to an anchor
- Closed
-
QTBUG-14957 Only core QML elements can have implicit size
- Closed
-
QTBUG-7300 Improve image caching
- Closed
-
QTBUG-15279 Add versioning to new properties in QtQuick 1.1
- Closed
-
QTBUG-15148 Enable setting resize origin for zooming
- Closed
-
QTBUG-16059 Implement deselect() function for TextInput and TextEdit elements
- Closed
-
QTBUG-12306 Add Item.nextSibling and Item.previousSibling properties
- Open
-
QTBUG-15149 QML Transition element should have "enabled" property
- Closed
-
QTBUG-14296 QML - add support for Text leading (line-spacing)
- Closed
-
QTBUG-11042 Add right-to-left locale support to QtQuick elements
- Closed
-
QTBUG-13351 Qml Viewer runtime.activeWindow functionality should be available for standalone QML applications
- Closed
-
QTBUG-14900 very hard to reload QML Image
- Closed
-
QTBUG-15161 No way of identifying elements created by Repeater
- Closed
-
QTBUG-9712 Image and Text "sizeHints" are hidden in QML components
- Closed
-
QTBUG-11876 Provide row and col spacing properties in Grid object
- Closed
-
QTBUG-12305 TextEdit and Text elements lack visibleLines and maximumVisibleLines properties
- Closed
-
QTBUG-12704 Suggestion to add a reload function to to qml Image
- Closed
-
QTBUG-13242 Support for justification in Text element
- Closed
-
QTBUG-14488 Transition enabled property
- Closed
- relates to
-
QTBUG-13799 Change QML core module to QtQuick 1.0
- Closed