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
For Gerrit Dashboard: QTBUG-50992 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
161723,2 | WIP: Ugly workaround for "Object destroyed during incubation" issues | 5.7 | qt/qtquickcontrols2 | Status: ABANDONED | -2 | 0 |
162519,3 | WIP: Cancel incubation of replaced delegates | 5.7 | qt/qtquickcontrols2 | Status: DEFERRED | -2 | 0 |
162520,3 | WIP: Allow canceling incubation | 5.7 | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
170457,8 | Delete replaced delegates after Component.completed() is emitted | 5.7 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
181516,5 | Allow canceling incubation | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
181519,1 | WIP: Cancel incubation of replaced delegates | 5.8 | qt/qtquickcontrols2 | Status: ABANDONED | -2 | 0 |
184420,3 | Cancel incubation of replaced/destroyed delegates | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
190874,3 | Cancel incubation recursively | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
194963,3 | QQuickComboBox: fix crash on popup destruction | 5.9.0 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
204692,9 | Control: defer the execution of the background item | 5.9 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
204693,10 | Slider: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
204998,11 | ComboBox: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
205004,3 | AbstractButton: defer the execution of the indicator | 5.9 | qt/qtquickcontrols2 | Status: ABANDONED | 0 | 0 |
205005,6 | Dial: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
205006,10 | TextField: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
205100,5 | TextArea: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
205103,7 | Label: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
205104,3 | GroupBox: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
205105,1 | ComboBox: defer the execution of the label | 5.9 | qt/qtquickcontrols2 | Status: ABANDONED | 0 | 0 |
205107,5 | SpinBox: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
205111,7 | RangeSlider: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
205112,2 | WIP: Enable deferring of contentItem for AbstractButton | 5.9 | qt/qtquickcontrols2 | Status: ABANDONED | -2 | 0 |
206114,13 | Buttons: defer the execution of the delegates | 5.9 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
208681,15 | More fine-grained deferred property execution | 5.9 | qt/qtdeclarative | Status: MERGED | -2 | 0 |
214118,9 | Migitate the performance regression caused by deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
214229,2 | Optimize QQmlObjectCreator::populateDeferredBinding() | 5.9 | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
214230,3 | Optimize deferred execution | 5.9 | qt/qtquickcontrols2 | Status: ABANDONED | -2 | 0 |
214355,2 | ApplicationWindow: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
214357,2 | Pane: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
214481,4 | Extend and improve tst_customization | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
214508,2 | Control: defer the execution of the content item | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
214573,4 | Popups: use deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |
216455,11 | Make Tumbler compatible with deferred execution | 5.9 | qt/qtquickcontrols2 | Status: ABANDONED | -2 | 0 |
216482,3 | Revert "Allow canceling incubation" | 5.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
216570,2 | MenuItem: use deferred execution for the arrow | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
216580,3 | Tumbler: cleanup internal IDs | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
216587,2 | ComboBox: fix popup's deferred execution for the new styles | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
216872,7 | Make Tumbler compatible with deferred execution | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
217029,2 | Imagine/SpinBox: cleanup internal IDs for deferred execution | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
217030,2 | Imagine/GroupBox: cleanup internal IDs for deferred execution | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
217148,2 | Imagine/BusyIndicator: cleanup internal IDs for deferred execution | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
217160,3 | Imagine/ProgressBar: cleanup internal IDs for deferred execution | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
217165,2 | Imagine/DelayButton: cleanup internal IDs for deferred execution | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
217169,2 | Imagine/Switch(Delegate): cleanup internal IDs for deferred execution | 5.10 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |