PDA

View Full Version : Customize QPushButton and QComboBox



fruzzo
8th June 2012, 16:30
Hi,
I'm creating a custom style from the QWindowsStyle and I want that the look and fell of a QComboBox is the same of the QPushButton one...following the NorwegianWoodStyle example, I reimplemented the PE_PanelButtonCommand but unfortunately this new look and feel is applied only to the QPushButton. Why? I noticed that in NorwegianWoodStyle it probabily works fine because it inherits from QMotifStyle instead my custom style inherits from QWindowsStyle.

wysota
8th June 2012, 22:20
The combobox is drawn by CC_ComboBox you in a general case you need to reimplement drawComplexControl() and handle CC_ComboBox to do what you want. It works in the norwegian wood example because motif style asks the style to draw the button panel from within handling CC_ComboBox.