Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task-number: QTBUG-15257 Change-Id: I539b6e6a9e0e0172b68e8002aaa3f7c7e6648769 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
- Loading branch information
Aaron Kennedy
authored and
Qt by Nokia
committed
Oct 26, 2011
1 parent
a927dc9
commit b79ceab
Showing
13 changed files
with
160 additions
and
49 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
45 changes: 45 additions & 0 deletions
45
tests/auto/declarative/qdeclarativeecmascript/data/readonlyDeclaration.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,45 @@ | ||
import QtQuick 2.0 | ||
|
||
QtObject { | ||
property int dummy: 13 | ||
|
||
readonly property int test1: 19 | ||
readonly property int test2: dummy * 49 | ||
readonly property alias test3: other.test | ||
|
||
property bool test: false | ||
|
||
property var dummyObj: QtObject { | ||
id: other | ||
property int test: 9 | ||
} | ||
|
||
Component.onCompleted: { | ||
if (test1 != 19) return; | ||
if (test2 != 637) return; | ||
if (test3 != 9) return; | ||
|
||
var caught = false; | ||
|
||
caught = false; | ||
try { test1 = 13 } catch (e) { caught = true; } | ||
if (!caught) return; | ||
|
||
caught = false; | ||
try { test2 = 13 } catch (e) { caught = true; } | ||
if (!caught) return; | ||
|
||
caught = false; | ||
try { test3 = 13 } catch (e) { caught = true; } | ||
if (!caught) return; | ||
|
||
other.test = 13; | ||
dummy = 9; | ||
|
||
if (test1 != 19) return; | ||
if (test2 != 441) return; | ||
if (test3 != 13) return; | ||
|
||
test = true; | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
tests/auto/declarative/qdeclarativelanguage/data/ReadOnlyType.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,5 @@ | ||
import QtQuick 2.0 | ||
|
||
QtObject { | ||
readonly property int readOnlyProperty: 19 | ||
} |
1 change: 0 additions & 1 deletion
1
tests/auto/declarative/qdeclarativelanguage/data/property.5.errors.txt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
tests/auto/declarative/qdeclarativelanguage/data/property.5.qml
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt
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 |
---|---|---|
@@ -1 +1 @@ | ||
3:27:Invalid property assignment: "readOnlyEnumProperty" is a read-only property | ||
2:23:Invalid property assignment: "readOnlyProperty" is a read-only property |
5 changes: 2 additions & 3 deletions
5
tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import Test 1.0 | ||
MyTypeObject { | ||
readOnlyEnumProperty: MyTypeObject.EnumValue1 | ||
ReadOnlyType { | ||
readOnlyProperty: 13 | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/auto/declarative/qdeclarativelanguage/data/readonly.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,17 @@ | ||
import Test 1.0 | ||
|
||
MyQmlObject { | ||
property int testData: 9 | ||
property alias testData2: myObject.test1 | ||
|
||
readonly property int test1: 10 | ||
readonly property int test2: testData + 9 | ||
readonly property alias test3: myObject.test1 | ||
|
||
|
||
property variant dummy: MyQmlObject { | ||
id: myObject | ||
property int test1: 13 | ||
} | ||
} | ||
|
Oops, something went wrong.