[libraries/kirigami-addons] src/formcard: Don't try to compute the implicit width of invisible FormCards

Volker Krause <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c3d5241d19fb6401bd87fbe4b3e805943123e321 by Volker Krause.
Committed on 20/07/2026 at 15:46.
Pushed by carlschwan into branch 'master'.

Don't try to compute the implicit width of invisible FormCards

Amends fd8a5e2f126f9a.

This causes an infinite loop freezing the application (ie. far worse than
a normal binding loop that Qt manages to break).

Observed in Itinerary's editor pages but can easily be tested in
FormTestApp.qml by setting the card containing the date/time delegates to
invisible.

M  +1    -1    src/formcard/FormCard.qml

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

diff --git a/src/formcard/FormCard.qml b/src/formcard/FormCard.qml
index 6ac7924c..e99cc77e 100644
--- a/src/formcard/FormCard.qml
+++ b/src/formcard/FormCard.qml
@@ -89,7 +89,7 @@ Item {
     Layout.fillWidth: true
 
     implicitHeight: topPadding + bottomPadding + internalColumn.implicitHeight + rectangle.borderWidth * 2
-    implicitWidth: leftPadding + rightPadding + internalColumn.implicitWidth + rectangle.borderWidth * 2
+    implicitWidth: visible ? leftPadding + rightPadding + internalColumn.implicitWidth + rectangle.borderWidth * 2 : 0.0
 
     Kirigami.ShadowedRectangle {
         id: rectangle
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.