[Qt] Custom combobox drawing

zeljko zeljko at holobit.net
Tue Nov 11 10:46:43 CET 2008

On Tuesday 11 November 2008 09:18, Paul Ishenin wrote:
> Hello,  Items specific to the Qt widget set.
> Most widgetsets like win32, gtk2 supported custom drawing of
> non-dropdown part of combobox (dont know how to call it - it is a part
> that always visible and where selected item is painted). Although on
> windows it is possible only when combobox itself is readonly.
> I searched Qt examples and have not found any where this is shown. I see
> Qt only supports custom painting of the drop down part.

Because ItemDelegate is part of Model/View framework, and dropdown list IS a 

> On the other hand I also see that item icon can be painted both in the
> drop down part and in the non-dropdown part. How it can be?

> Does this limitation actually exists or it is somehow limited in our
> implementation? For example I found that QCombobox internally uses
> QComboMenuDelegate and QComboBoxDelegate. QComboMenuDelegate do
> something with that item.icon. Maybe we've choosen wrong parent for our
> item delegate or it is something else?

I don't understand this part.

> I need answers on next questions:
> 1. Is it possible to custom draw non-dropdown part of combo

hmm...I don't think that's possible without overriding paintEvent().

> 2. What should we do to implement this

make QLCLComboBox() ;)


More information about the Qt mailing list