[Qt-interest] QCombox ListView Spacing

Jake Colman colman at ppllc.com
Tue Jun 21 14:18:53 CEST 2011


I'd like to change the default spacing of items listed in the ComboBox
dropdown so that there is a little more space in between each item.  As
it stands it looks a bit cramped.

The following code looks like it should work

    dynamic_cast<QListView*>(view())->setSpacing(1);

since it sets the spacing of the ComboBox's underlying ListView.
Unfortunately, while it does increase the spacing it also messes up the
display of the dropdown list.  If the list contains 5 items, for
example, it will have extra space after the last item which causes
vertical scrollbars to be drawn even though they should not be needed.

Can anyone suggest another way to solve this problem?

Thanks.

...Jake


-- 
Jake Colman | Director, Software Development
Principia Partners LLC
101 West Elm Street | Conshohocken | PA 19428 | +1 (610) 755 9770
t: +1 (610) 755 9786 | c: +1 (610) 348 2788 | f: +1 (201) 221 8929
e: colman at ppllc.com | w: www.principiapartners.com
Credit technology innovation awards winner 2008, 2009 & 2010




More information about the Qt-interest-old mailing list