Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test verifying that QObject-derived pointer is passed correctly.
Ensure that an object derived from QObject is correctly passed to an invokable function from QML. Change-Id: I71eefe8c480e1f1574804d05244b53f29c7fbf0d Reviewed-by: Martin Jones <martin.jones@nokia.com>
- Loading branch information
Matthew Vogt
authored and
Qt by Nokia
committed
Feb 22, 2012
1 parent
6f96bf2
commit 136f235
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
tests/auto/declarative/qdeclarativeecmascript/data/qobjectDerivedArgument.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 QtQuick 2.0 | ||
import Qt.test 1.0 | ||
|
||
MyQmlObject { | ||
id: root | ||
stringProperty: 'hello' | ||
property var child | ||
|
||
property bool result: false | ||
|
||
Component.onCompleted: { | ||
child = invokable.createMyQmlObject('goodbye'); | ||
|
||
result = (invokable.getStringProperty(root) == 'hello') && | ||
(invokable.getStringProperty(child) == 'goodbye'); | ||
} | ||
} |
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