[Qt] Custom combobox drawing

Paul Ishenin ip at kmiac.ru
Tue Nov 11 09:18:51 CET 2008

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.

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 need answers on next questions:
1. Is it possible to custom draw non-dropdown part of combo
2. What should we do to implement this

Best regards,
Paul Ishenin.

More information about the Qt mailing list