Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for assigning literal value to sequence property
It is a language semantic that we allow clients to assign a single value to a sequence/list property (assuming that the types match). Now that we support sequence types, this commit adds support for this semantic by determining whether the built-in type of the literal corresponds to the associated sequence (eg, int for QList<int>, qreal for QList<qreal>, bool for QList<bool>, QString for QStringList etc). Similarly, some value types can be constructed from literal string values (via string converters) and these need to be handled also. Task-number: QTBUG-18062 Task-number: QTBUG-21770 Change-Id: Iacd91b2af122cd8f20b7df2fa6056a7d7c52bf53 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
- Loading branch information
Chris Adams
authored and
Qt by Nokia
committed
Dec 1, 2011
1 parent
f304dd6
commit fdbdbbd
Showing
12 changed files
with
394 additions
and
0 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
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
11 changes: 11 additions & 0 deletions
11
tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.1.qml
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,11 @@ | ||
import QtQuick 2.0 | ||
import Qt.test 1.0 | ||
|
||
MySequenceConversionObject { | ||
intListProperty: [1, 2] | ||
qrealListProperty: [1.1, 2.2] | ||
boolListProperty: [false, true] | ||
urlListProperty: [ "http://www.example1.com", "http://www.example2.com" ] | ||
stringListProperty: [ "one", "two" ] | ||
qstringListProperty: [ "one", "two" ] | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.2.qml
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,11 @@ | ||
import QtQuick 2.0 | ||
import Qt.test 1.0 | ||
|
||
MySequenceConversionObject { | ||
intListProperty: 1 | ||
qrealListProperty: 1.1 | ||
boolListProperty: false | ||
urlListProperty: "http://www.example1.com" | ||
stringListProperty: "one" | ||
qstringListProperty: "two" | ||
} |
Oops, something went wrong.