diff options
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 09936f6e7a..38a16b8cde 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -1270,6 +1270,21 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru return sharedState->rootContext; } +void QQmlObjectCreator::cancel(QObject *object) +{ + int last = sharedState->allCreatedObjects.count() - 1; + int i = last; + while (i >= 0) { + if (sharedState->allCreatedObjects.at(i) == object) { + if (i < last) + qSwap(sharedState->allCreatedObjects[i], sharedState->allCreatedObjects[last]); + sharedState->allCreatedObjects.pop(); + break; + } + --i; + } +} + void QQmlObjectCreator::clear() { if (phase == Done || phase == Finalizing || phase == Startup) |