Bug 425865

Summary: editable combobox fairly broken
Product: [Frameworks and Libraries] frameworks-qqc2-desktop-style Reporter: Harald Sitter <sitter>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: kde, kde, nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: main.qml (minimal example)

Description Harald Sitter 2020-08-27 12:17:27 UTC
Created attachment 131216 [details]
main.qml (minimal example)

ComboBox{editable:true} is fairly broken with the org.kde.desktop style.
Auto completion isn't working.
When trying to click on the indicator to open the selection it doesn't stay open.

See attached example file.
- Try to type Bana and see it not offering autocompletion
- Click on indicator and see it not staying open

Works fine with fusion, universal and material style.
Comment 1 David Redondo 2020-08-28 08:49:24 UTC
See https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/19 for the second issue
Comment 2 Chris Holland 2020-10-13 15:13:18 UTC
Git commit 2d8d877373e088f94675a0d1fc969bf6dd048a26 by Chris Holland.
Committed on 13/10/2020 at 15:04.
Pushed by cholland into branch 'master'.

ComboBox.contentItem must be a QQuickTextInput to fix autocomplete

See QQuickComboBoxPrivate::updateEditText()
https://github.com/qt/qtquickcontrols2/blob/dev/src/quicktemplates2/qquickcombobox.cpp#L426

By removing the MouseArea previously in the contentItem, we lose the
ability to press+hold+drag to select a drop down item.

A MouseArea has been added to the background component to capture
wheel events in a similar pattern to PlasmaComponents3.ComboBox.

The ComboBox previously closed the popup when releasing the click to
open the dropdown when editable=true.

M  +56   -107  org.kde.desktop/ComboBox.qml
M  +7    -0    tests/testComboBox.qml

https://invent.kde.org/frameworks/qqc2-desktop-style/commit/2d8d877373e088f94675a0d1fc969bf6dd048a26