[Kde-pim] QComboBox/ItemDelegate question

Tobias Koenig tokoe at kde.org
Wed Nov 4 19:31:36 GMT 2009


On Wed, Nov 04, 2009 at 07:17:27PM +0100, Tobias Koenig wrote:
> On Wed, Nov 04, 2009 at 03:46:10PM +0000, Stephen Kelly wrote:
Hej,

> > Have you considered putting the data into a multi column list or table like 
> > a QStandardItemModel and putting that model into the combobox? You should be 
> > able to put the description in the second column.
> Unfortunately that doesn't fix the issue, that the popup menu is too thin,
> with a QTableView the content of the items is only shown half...
I've implemented it the following way now:

  - install an event filter on QComboBox::view()->viewport()
  - listen for the 'QEvent::Show' event of the viewport
  - resize the viewport->parentWidget()->parentWidget() to the according size

not really convenient but it allows one to have a popup menu with a different
width than the combobox.

Ciao,
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20091104/f166b4df/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list