PDA

View Full Version : [Qt 4.3.1]A problem with combobox style



Tamara
18th September 2007, 04:01
For my application I use Cleanlooks style.
And I have one problem with it: making combobox uneditable changes its color to gray and up-down arrow to down arrow.
My chief don't like such behaviour and I want to make uneditable combobox looks like editable (i.e. I want to set combobox stylesheet to 'QComboBox::!editable {QComboBox::editable}'). How can I do it in most simple way?:confused: I don't want to inherit combobox to change its behaviour, I hope that there is more simple way.

wysota
18th September 2007, 11:01
Modify the style. It should be as easy as reimplementing a single method (QStyle::drawComplexControl) and changing the behaviour for drawing a disabled combobox.

Tamara
19th September 2007, 10:46
I should wrote my own style inheriting QStyle and reimplementing drawComplexControl and set my combobox style to the style. Do i understand you correctly?

wysota
19th September 2007, 10:49
Inherit the cleanlooks style (not QStyle) and reimplement drawComplexControl. Then set your application's style to the new style (it will have all features of Cleanlooks with that only difference that disabled comboboxes will be rendered like active ones).