Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support (registered) non-local enums for signal/slot params in QML.
It's now possible to detect whether a registered type is an enum, allowing registered non-local enums to be used as parameters in signals and slots from QML/C++. Author: Glenn Watson <glenn.watson@nokia.com> Task-number: QTBUG-20639 Change-Id: I8c439f2dcc7bfd8ec31914b0c86cd3a1de3c038c Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
- Loading branch information
Michael Brasser
authored and
Qt by Nokia
committed
Mar 21, 2012
1 parent
fd80285
commit 37cd29b
Showing
7 changed files
with
154 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import QtQuick 2.0 | ||
import Test 1.0 | ||
|
||
Item { | ||
MyEnum1Class { | ||
id: enum1Class | ||
objectName: "enum1Class" | ||
} | ||
|
||
MyEnumDerivedClass { | ||
id: enumDerivedClass | ||
objectName: "enumDerivedClass" | ||
|
||
onValueAChanged: { | ||
aValue = newValue; | ||
} | ||
|
||
onValueBChanged: { | ||
bValue = newValue; | ||
} | ||
|
||
property int aValue: 0 | ||
property int bValue: 0 | ||
} | ||
|
||
function setEnumValues() { | ||
enum1Class.setValue(MyEnum1Class.A_13); | ||
enumDerivedClass.setValueA(MyEnum1Class.A_11); | ||
enumDerivedClass.setValueB(MyEnum2Class.B_37); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters