Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.7.1, 5.8.0 RC, 5.9.0, 5.13.0
-
numerous
Description
Using customized controls in item views or asynchronous loader often leads to "Object destroyed during incubation" or "Error creating delegate". The problem occurs with basically any control when replacing the default background, content item, or any other building block with a custom one. Controls cleanup the old default content, which leads to a "Object destroyed during incubation" -error, and then the incubation of the whole control fails.
In item views the problem occurs occasionally, leading to missing delegate instances (QML VisualDataModel: Error creating delegate):
import QtQuick 2.6 import QtQuick.Controls 2.0 ApplicationWindow { visible: true width: 640 height: 480 GridView { id: gridThing; anchors.fill: parent; cellWidth: 75; cellHeight: 75; model: 500; delegate: Button { id: control text: "Test" width: gridThing.cellWidth; height: gridThing.cellHeight; background: Rectangle { implicitHeight: 20; implicitWidth: 20; color: "red"; width: control.width; height: control.height; x: 0; y: 0; } } } }
In asynchronous loaders the issue is 100% reproducible with certain control structures:
import QtQuick 2.6 import QtQuick.Controls 2.0 ApplicationWindow { id: root visible : true width : 640 height : 480 property bool triggerTheBug: true // Swap this to see a normal display of the ComboBox StackView { id: myStackView anchors.fill: parent initialItem: Loader { anchors.fill: parent asynchronous : triggerTheBug sourceComponent : ComboBox { popup : Popup{} } // BUG //ComboBox { background : Rectangle{} } // BUG //ComboBox { contentItem: Rectangle{} } // BUG //ComboBox { delegate : ItemDelegate{} } // NO BUG } } }
Under the hood, the problem is that QQmlIncubator + QQmlObjectCreator + QQmlVMEGuard tracks all instantiated child objects using QPointer and doesn't like that any of them gets destroyed during the incubation process. Calling deleteLater() is not sufficient, because it would not be synchronized with the incubation controller.
Attachments
Issue Links
- depends on
-
QTBUG-63200 Deferred properties are not always executed
- Closed
- is duplicated by
-
QTBUG-53400 Adding asynchronous Loader into StackView results in "Object destroyed during incubation" error
- Closed
-
QTBUG-52096 Qt Quick Controls 2 Button fails creation in GridView
- Closed
-
QTBUG-52955 Regression: ItemDelegate with overriden contentItem in ListView fails to create on Android
- Closed
-
QTBUG-53496 Customized Qt.labs ComboBox won't display in an asynchronous Loader
- Closed
- is required for
-
AUTOSUITE-189 Regression on Qt 5.9.4 breaks Neptune Styling
- Closed
-
QTBUG-85097 Async loader and QQC2: Object destroyed during incubation
- Closed
- relates to
-
QTBUG-98439 "Binding on contentItem is not deferred as requested by the DeferredPropertyNames class info because it constitutes a group property" when instantiating ScrollBar
- Closed
- resulted in
-
QTBUG-65955 Button is not visible if its background property is set as a Rectangle
- Closed
-
QTBUG-65880 [REG 5.9.3 => 5.9.4] Popup opened at 0, 0 has no background
- Closed
-
QTBUG-65962 [REG: 5.9.3->5.9.4] ComboBox popup doesn't show up
- Closed
-
QTBUG-66449 QML RangeSlider Crash
- Closed
-
QTBUG-66453 REG: Material elevation in Page header
- Closed
-
QTBUG-66614 REG: ToolButton.contentItem for anchors and source for ColorOverlay no longer works
- Closed
-
QTBUG-67334 Regression: ScrollView+TextArea do not scroll correctly
- Closed
-
QTBUG-57823 TabBar does not display when setting contentItem property
- Closed
-
QTBUG-63036 qmlDeferredExecute() crashes with grouped properties
- Closed