Bug 446878

Summary: Combobox not resizing to all of its content
Product: [Frameworks and Libraries] frameworks-qqc2-desktop-style Reporter: Alexander Stippich <a.stippich>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ahiemstra, kde, nate, noahadvs
Priority: NOR    
Version: 5.88.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Alexander Stippich 2021-12-12 11:53:56 UTC
SUMMARY
The combobox is not resizing to fit the width to its content, unlike the qtwidgets counterpart.
The width is hardcoded to a minimum of 200, sometimes occupying way too much space.

Worse is that the combobox also resizes its width when a longer text entry is selected than the current one (and too long for a width of 200). This makes it impossible to correctly size the parent view for the combobox.
The width is not initially determined by all of the text entries in the model. Just the current selected text is used to determine the width, causing the change of width when selecting other entries.

Occurs for example within Skanpage (somehwat linked to Bug 445035)

STEPS TO REPRODUCE
1. Open Skanpage with the test backend
2. Change the source option from Flatbed to Automatic Document Feeder and back

OBSERVED RESULT
Combobox changes its width
most of the other options with a combobox have a width that is too large.

EXPECTED RESULT
Combobox is initially correctly sized to fit all of its content and does not enforce a minimum width 

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2021-12-14 17:47:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/111
Comment 2 Nate Graham 2021-12-14 18:40:18 UTC

*** This bug has been marked as a duplicate of bug 403153 ***