Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
None
-
5.4.0
-
None
-
b7738beda651c2927e1a9d58c592148b1dc99576
Description
A common problem for controls is that when the business logic is implemented in a C++ "base" type and the visual parts in a QML "sub" type, enum values provided by the C++ type cannot be accessed by the QML type name.
Example: a TextField control that inherits QQuickTextInput.
// TextField.qml
TextInput {
id: control
implicitWidth: ...
implicitHeight: ...
Rectangle {
id: background
z: -1
}
}
Application code cannot use eg. TextField.Password but must use TextInput.Password instead:
TextField { // echoMode: TextField.Password // "ReferenceError: TextField is not defined" // vs. echoMode: TextInput.Password // :( }
Attachments
Issue Links
- relates to
-
QTBUG-39607 Enum type of a alias is lost
-
- Open
-
-
QTBUG-43581 Attached properties declared in C++ base type
-
- Closed
-