Bug 513185 - Binding loop detected for property "wideMode" errors for users of Kirigami.FormLayout
Summary: Binding loop detected for property "wideMode" errors for users of Kirigami.Fo...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.20.0
Platform: Other Linux
: NOR minor
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-10 17:57 UTC by Nate Graham
Modified: 2025-12-19 22:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2025-12-10 17:57:00 UTC
E.g. opening `systemsettings kcm_powerdevilprofilesconfig` produces the following:

qrc:/kcm/kcm_powerdevilprofilesconfig/main.qml:172:21: QML ProfileConfig: Binding loop detected for property "wideMode":
qrc:/qt/qml/org/kde/kirigami/layouts/FormLayout.qml:72:5
Comment 1 Bug Janitor Service 2025-12-15 16:20:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/1995
Comment 2 cwo 2025-12-19 22:29:53 UTC
Git commit f8b4aadf1b79b983fe00b9c5f6dea296b80c6027 by Christoph Wolk.
Committed on 19/12/2025 at 22:25.
Pushed by cwo into branch 'master'.

layouts/FormLayout: avoid binding loop during initial load

FormLayout tracks the implicit width in wide mode in a separate property
and uses this to decide which mode to use. When the implicitWidth
changes, this property is updated with a 0-ms timer, i.e. when the event
loop is clear. This generally prevents a binding loop. But during a
relayout, the update happens immediately, and then can cause a binding
loop, in particular during initialization of the page as at this point
the sizing can widely vary, and the component flips between wide and
narrow mode as contents are added and the available size of the layout
itself is determined. In this case, it may (and usually does) happen
that the component thinks wide mode should be off, some change triggers
a reevluation of the binding, it's changed to on, the
wideModeImplicitWidth is updated and the binding may be reevaluated
again while it's still in the process of finishing up the previous one,
which triggers the binding loop detection.

Instead, we make relayouting also use the timer, rather than immediately
triggering its effect. This avoids the loop. We also trigger it
explicitly in Component.onCompleted as the test (and potentially other
things) expects it to be match after that.

M  +5    -2    src/layouts/FormLayout.qml

https://invent.kde.org/frameworks/kirigami/-/commit/f8b4aadf1b79b983fe00b9c5f6dea296b80c6027