Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement script module api property get and set
This commit adds code for property get and set for script module APIs, and also splits up the module API unit tests into QObject and Script (QJSValue) parts. Related to commit: 3ee8a19 Task-number: QMLNG-33 Task-number: QTBUG-17318 Change-Id: I4aaf5d1cc1d4774dd0f0999f0985439e4d76f0ca Reviewed-on: http://codereview.qt.nokia.com/1472 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
- Loading branch information
Chris Adams
authored and
Qt by Nokia
committed
Aug 30, 2011
1 parent
6cec35c
commit be244df
Showing
13 changed files
with
223 additions
and
61 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
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
...qdeclarativeecmascript/data/moduleApi.qml → ...cript/data/moduleapi/qobjectModuleApi.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
2 changes: 0 additions & 2 deletions
2
...ativeecmascript/data/moduleApiCaching.qml → ...ata/moduleapi/qobjectModuleApiCaching.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,12 +1,10 @@ | ||
import QtQuick 2.0 | ||
|
||
import Qt.test 1.0 as QtTest // module API installed into existing uri | ||
import Qt.test.scriptApi 1.0 as QtTestScriptApi // script module API installed into new uri | ||
import Qt.test.qobjectApiParented 1.0 as QtTestParentedQObjectApi // qobject (with parent) module API installed into a new uri | ||
|
||
QtObject { | ||
property int existingUriTest: QtTest.qobjectTestProperty | ||
property int scriptTest: QtTestScriptApi.scriptTestProperty | ||
property int qobjectParentedTest: QtTestParentedQObjectApi.qobjectTestProperty | ||
} | ||
|
3 changes: 1 addition & 2 deletions
3
...ativeecmascript/data/moduleApiWriting.qml → ...ata/moduleapi/qobjectModuleApiWriting.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
6 changes: 6 additions & 0 deletions
6
tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/scriptModuleApi.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,6 @@ | ||
import QtQuick 2.0 | ||
import Qt.test.scriptApi 1.0 as QtTestScriptApi // script module API installed into new uri | ||
|
||
QtObject { | ||
property int scriptTest: QtTestScriptApi.scriptTestProperty // script module api's only provide properties. | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/scriptModuleApiCaching.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,6 @@ | ||
import QtQuick 2.0 | ||
import Qt.test.scriptApi 1.0 as QtTestScriptApi // script module API installed into new uri | ||
|
||
QtObject { | ||
property int scriptTest: QtTestScriptApi.scriptTestProperty | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/scriptModuleApiWriting.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,32 @@ | ||
import QtQuick 2.0 | ||
import Qt.test.scriptApi 1.0 as QtTestScriptApi | ||
import Qt.test.scriptApi 2.0 as QtTestScriptApi2 | ||
|
||
QtObject { | ||
property int firstProperty | ||
property int readBack | ||
|
||
property int secondProperty | ||
property int unchanged | ||
|
||
onFirstPropertyChanged: { | ||
if (QtTestScriptApi.scriptTestProperty != firstProperty) { | ||
QtTestScriptApi.scriptTestProperty = firstProperty; | ||
readBack = QtTestScriptApi.scriptTestProperty; | ||
} | ||
} | ||
|
||
onSecondPropertyChanged: { | ||
if (QtTestScriptApi2.scriptTestProperty != secondProperty) { | ||
QtTestScriptApi2.scriptTestProperty = secondProperty; | ||
unchanged = QtTestScriptApi2.scriptTestProperty; | ||
} | ||
} | ||
|
||
Component.onCompleted: { | ||
firstProperty = QtTestScriptApi.scriptTestProperty; | ||
readBack = QtTestScriptApi.scriptTestProperty; | ||
secondProperty = QtTestScriptApi2.scriptTestProperty; | ||
unchanged = QtTestScriptApi2.scriptTestProperty; | ||
} | ||
} |
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
Oops, something went wrong.