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
Ensure that dynamic property storing QObject ptr notifies on delete
Previously, when a QObject ptr was stored in a dynamic variant property, the value of the property could change (to a zero ptr) if the QObject was deleted without a notify signal being emitted by the QDeclarativeVMEMetaObject which stores the property. This commit ensures that such a notify signal is emitted correctly. Task-number: QTBUG-23451 Change-Id: I5689abd984b177737f8d5f18950838b73ebde328 Reviewed-by: Martin Jones <martin.jones@nokia.com>
- Loading branch information
Chris Adams
authored and
Qt by Nokia
committed
Mar 14, 2012
1 parent
a27fd58
commit b061083
Showing
5 changed files
with
99 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import QtQuick 2.0 | ||
import Qt.test 1.0 | ||
|
||
Item { | ||
id: root | ||
property bool test: false | ||
property QtObject objectProperty | ||
|
||
onObjectPropertyChanged: { | ||
root.test = true; | ||
} | ||
|
||
property Component c: Component { | ||
id: dynamicComponent | ||
QtObject { | ||
id: dynamicObject | ||
} | ||
} | ||
|
||
function create() { | ||
root.objectProperty = root.c.createObject(root); | ||
} | ||
|
||
function destroy() { | ||
root.test = false; // reset test | ||
root.objectProperty.destroy(100); | ||
// in cpp, wait objectProperty deletion, inspect "test" and "objectProperty" | ||
// test should be true and value of objectProperty should be zero. | ||
} | ||
} |
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