Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2008-11

Custom combobox drawing

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul Ishenin

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.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 9 lines
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 model/view.

Show quoted text 9 lines
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() ;)

zeljko

Reply by email