Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Component.incubateObject() autotest
Change-Id: I37f76d5b273ae4f032c4de5ac8fcbff4204b78fe Reviewed-on: http://codereview.qt-project.org/6200 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Sanity-Review: Aaron Kennedy <aaron.kennedy@nokia.com>
- Loading branch information
Aaron Kennedy
authored and
Qt by Nokia
committed
Oct 11, 2011
1 parent
6fcaca3
commit 3422d4a
Showing
3 changed files
with
127 additions
and
5 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
36 changes: 36 additions & 0 deletions
36
tests/auto/declarative/qdeclarativecomponent/data/incubateObject.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,36 @@ | ||
import QtQuick 2.0 | ||
|
||
Item{ | ||
id: root | ||
|
||
property bool test1: false | ||
property bool test2: false | ||
|
||
property var i | ||
|
||
Component{ | ||
id: component | ||
Item { | ||
property int dummy: 13 | ||
property int dummy2: 26 | ||
} | ||
} | ||
|
||
Component.onCompleted: { | ||
i = component.incubateObject(null, { dummy2: 19 }); | ||
|
||
if (i.status != Component.Loading) return; | ||
if (i.object != null) return; | ||
|
||
i.onStatusChanged = function(status) { | ||
if (status != Component.Ready) return; | ||
if (i.object == null) return; | ||
if (i.object.dummy != 13) return; | ||
if (i.object.dummy2 != 19) return; | ||
test2 = true; | ||
} | ||
|
||
test1 = 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