Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
5.12.1
-
None
Description
This means that the templates are loaded with the static version given in the relevant Control.qml file (or none, which means "latest"). Since most properties are declared and revisioned in the templates, this makes our versioning scheme entirely ineffective for QtQuick.Controls. For example:
Attempting to load this QML with qmlscene:
import QtQuick.Controls 2.2
RoundButton {
property string icon: ""
}
Produces the error:
file:///home/.../MyButton.qml:4 Cannot override FINAL property
Despite the fact that the icon property was introduced in QtQuick.Controls 2.3 and this code imports QtQuick.Controls 2.2.
There are a few possible solutions for this:
- Duplicate all the controls .qml files for each version that needs to be made available. That's not physically impossible, but clearly insane.
- Abandon the "templates" pattern and find some replacement from QQC. This sounds like a compatibility nightmare.
- Find a way to forward the version a module was imported with into its components and add syntax to use it, like "import QtQuick.Controls auto". Ulf has tried that and it's not easy. It may yet be possible, though.
- Add an "internal" qmldir-import. In qmldir imports you can already write "auto" and it works. The problem is that qmldir-imports are exposed not only to the module itself, but also to anyone who imports it. Restricting this to only the module itself is likely easier than the other options.
Attachments
Issue Links
- depends on
-
QTBUG-71278 Imports and versioning in QML
- Closed
- relates to
-
QTBUG-83153 SpinBox component versioning
- Reported