Bug 422461

Summary: FormLayout ignores Kirigami.FormData.buddyFor
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Rinigus <rinigus.git>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: nate, rinigus.git
Priority: NOR Keywords: regression
Version: Master   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Rinigus 2020-06-04 20:22:13 UTC
SUMMARY

Kirigami.FormData.buddyFor could be used to align label with an element in the form. Not sure when it changed, but it doesn't work anymore.

STEPS TO REPRODUCE

Simplest example would be from Kirigami Gallery app. In FormLayoutGallery, use the following with the radio buttons:

```
            ColumnLayout {
                Layout.rowSpan: 3
                Kirigami.FormData.label: "Label for radios:"
                Kirigami.FormData.buddyFor: firstRadio
                RadioButton {
                    checked: true
                    text: "One"
                }
                RadioButton {
                    text: "Two"
                }
                RadioButton {
                    id: firstRadio
                    text: "Three"
                }
            }
```

Notice that the `firstRadio` id is moved to the last RadioButton. Unfortunately, label is still aligned by the top.

I have not tested it in the Gallery app, but used it in Pure Maps. There the functionality got broken and noticed.


SOFTWARE/OS VERSIONS
KDE Frameworks Version: kde-frameworks/kirigami 5.70
Qt Version: 5.14.2
Comment 1 Marco Martin 2020-06-30 10:27:09 UTC
I don't think that ever worked.
buddyfor was designed to have the same meaning as QWidget's form layout buddies, its scope is to give focus to its buddie when the label is activated with own accelerator, for instance when the text contains an &
Comment 2 Nate Graham 2020-09-15 23:41:39 UTC
This exact thing is working as expected in Kirigami Gallery now on the Form Layout page. If it's still not working in Pure Maps, can you share the code that isn't working?