| Summary: | FormTextFieldDelegate: binding of text property breaks in TextField's onTextChanged | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] kirigami-addons | Reporter: | george fb <georgefb899> |
| Component: | general | Assignee: | Unassigned bugs <unassigned-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | carl |
| Priority: | NOR | ||
| Version First Reported In: | 1.10.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
SUMMARY ``` FormCard.FormTextFieldDelegate { id: tfd label: "ABC" text: btn.data // this binding breaks trailing: Button { id: btn property string data: "abc" text: data onClicked: btn.data = btn.data+"1" } } ``` The binding is broken in FormCard.FormTextFieldDelegate.qml https://invent.kde.org/libraries/kirigami-addons/-/blob/313d7c83a105bcb9aa3a3fac0941b5d5c2c6730d/src/formcard/FormTextFieldDelegate.qml#L301 STEPS TO REPRODUCE 1. run above sample 2. click button OBSERVED RESULT button text changes, but FormTextFieldDelegate text doesn't change EXPECTED RESULT FormTextFieldDelegate text changes too SOFTWARE/OS VERSIONS Operating System: CachyOS Linux KDE Plasma Version: 6.5.4 KDE Frameworks Version: 6.21.0 Qt Version: 6.10.1 Kernel Version: 6.18.3-arch1-1 (64-bit) Graphics Platform: Wayland POSSIBLE SOLUTIONS Using Synchronizer https://doc.qt.io/qt-6/qml-qt-labs-synchronizer-synchronizer.html ``` AbstractFormDelegate { id: root TextField { id: textField // text: root.text // onTextChanged: root.text = text Synchronizer on text { property alias source: root.text } } } ``` Using an alias for textField.text ``` AbstractFormDelegate { id: root property alias fieldText: textField.text TextField { id: textField // text: root.text // onTextChanged: root.text = text } } ```