[libraries/kirigami-addons/fix/formradiodelegate-deferred] src/formcard: FormRadioDelegate: Avoid assigning null to a deferred property

Linus Jahn <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9a6e5a03d304c2c380606adf5d0ca8cf829027d5 by Linus Jahn.
Committed on 06/08/2026 at 00:22.
Pushed by lnj into branch 'fix/formradiodelegate-deferred'.

FormRadioDelegate: Avoid assigning null to a deferred property

contentItem is a deferred property of QQuickControl. Assigning null to it
makes Qt begin a deferred creation that is never completed, so every
FormRadioDelegate inside a destroyed dialog leaves an in-progress creation
behind and the engine warns on teardown:

  There are still "N" items in the process of being created at engine
  destruction.

Use a zero-sized item instead, which keeps the layout unchanged: the
implicit size and the indicator position are identical for both variants,
with the Basic style as well as with qqc2-desktop-style.

The underlying Qt bug is QTBUG-148846, fixed by
https://codereview.qt-project.org/c/qt/qtdeclarative/+/758142

M  +6    -1    src/formcard/FormRadioDelegate.qml

https://invent.kde.org/libraries/kirigami-addons/-/commit/9a6e5a03d304c2c380606adf5d0ca8cf829027d5

diff --git a/src/formcard/FormRadioDelegate.qml b/src/formcard/FormRadioDelegate.qml
index 0c44f068..5187ec8f 100644
--- a/src/formcard/FormRadioDelegate.qml
+++ b/src/formcard/FormRadioDelegate.qml
@@ -127,7 +127,12 @@ T.RadioDelegate {
                 enabled: root.enabled
                 checked: root.checked
 
-                contentItem: null // Remove right margin
+                // A zero-sized item rather than null: assigning null to a deferred
+                // property makes Qt leak an in-progress creation (QTBUG-148846).
+                contentItem: Item {
+                    implicitWidth: 0
+                    implicitHeight: 0
+                }
                 spacing: 0
 
                 topPadding: 0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.