Bug 226793 - frameless combobox drawn without background
Summary: frameless combobox drawn without background
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: style (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-14 12:39 UTC by Tobias Koenig
Modified: 2010-02-14 18:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
combobox as it should look like (9.29 KB, image/png)
2010-02-14 12:40 UTC, Tobias Koenig
Details
combobox as it looks with oxygen (9.85 KB, image/png)
2010-02-14 12:41 UTC, Tobias Koenig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Koenig 2010-02-14 12:39:02 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

I use a KComboBox inside a QAbstractItemDelegate subclass and therefor call setFrame( false ) on it. In latest SVN trunk, the
Oxygen style does not paint the combobox correctly, it seems it is
missing to paint the background and shape. The text and drop down handle is drawn correctly.

Attached a screenshot of what it should look like (captured under Qt Platique style) and what it looks like with Oxygen.
Comment 1 Tobias Koenig 2010-02-14 12:40:57 UTC
Created attachment 40761 [details]
combobox as it should look like
Comment 2 Tobias Koenig 2010-02-14 12:41:46 UTC
Created attachment 40762 [details]
combobox as it looks with oxygen
Comment 3 Hugo Pereira Da Costa 2010-02-14 14:25:00 UTC
Hi Tobias
The behavior you observe (which I agree does not look very nice) is what setFrame(0) does (basically remove all the button specific painting - the frame- and keep the rest), as it is meant to render "flat" widgets, which some styles honor and some dont. 
Could you try either
- leave setFrame at its default value (true)
- use setAutoFillBackground( true ); (it should draw a "flat" grey background below the combobox).

Tell me if one of the above works.
Comment 4 Tobias Koenig 2010-02-14 15:00:11 UTC
SVN commit 1090029 by tokoe:

Fill the background of the combobox explicitly.

/me still wonders why Oxygen behaves differently from
all other styles...

BUG: 226793


 M  +1 -0      contactgroupeditordelegate.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1090029
Comment 5 Tobias Koenig 2010-02-14 15:09:08 UTC
Hej Hugo,

setFrame( true ) is no option, then the frame covers most of the cell
area and the actual content is nearly invisible (QDefaultItemEditorFactory::createEditor
uses the same technique btw)

The setAutoFillBackground works, but it is not as good as it has been
in previous Oxygen versions... please have a look at it whether it's possible
to restore the previous behaviour. setFrame( false ) should hide the stuff around
the content, but not e.g. the gradient of the combobox itself.

Ciao,
Tobias
Comment 6 Hugo Pereira Da Costa 2010-02-14 18:17:20 UTC
Yeah well. Indeed this "transparent" combobox when setFrame is zero is indeed a new feature. The idea behind it was that if one want to make a custom widget with a combobox embedded into it, one might want to have the parent background used and not the default one, that by default comes with a frame. Hence the "transparency" when setFrame( false ) is used, that can be overwritten when autoFillBackground is set to true. 
This was added to the code (a month or to ago) to answer a bug report that basically conflicts with yours. I am not sure I can come with a solution that make both bug reports happy. 

I tried to look in QComboBox to find if there was another flag that could be used to trigger "flat" comboboxes, but there are none, as far as I can tell. 

(as for other styles, they can differ in multiple ways: 
1/ they use a flat background for main windows and use the same for comboboxes (which we can't do in oxygen since the main window background is not flat, hence the transparency)
2/ they don't honor the noFrame option and would suffer from the same bug as the first one I tried to address)