Qt-interest Archive, April 2007
again qcombobox and model-view architecture
Message 1 in thread
Dear Experts,
in one of previous posts I was wondering how to put 'user' sort of
painting into the qcombobox. I have partial success
with model/view architecture, thus I make my own
model(QAbstractItemModel based) and view (QItemDelegate based) which
create model for my combo box displaying just hatches....
then i setModel and setItemDelegate to get desired hatches nicely paint
on combobox..
now the thing is,,,,, this is working only for list box which is
displayed when you press button to see the list of items in combo,
however it doesn't affect at all the interior of qcombobox itself.
in assistant is written that setModel/setItemDelegate affects only list
created, fair enough, but what shall I rewrite to get my
bitmap also in main QComboBox??? It seems that it asks the model I did
for DisplayRole because the string displayed in the listbox
and combobox match correctly, however, the qcombobox doesn't use my
delegate to ask for UserRole data which do the painting of
my stuff.....
has anyone the same sort of problems? i wonder how to implement it
correctly....
thanks
d.
--
[ signature omitted ]