[Qt-interest] QComboBox item size for touch screen

Tim W timpie.w at gmail.com
Sun May 17 08:57:21 CEST 2009


>I'm implementing a touch screen interface that's needs a better size
>of the items, but currently I cannot set the item size for a better
>user experience.

Write a custom delegate for the views and adjust the sizeHint.  Something
like this. (watch out haven't compiled this an i'm still on my first cup of
coffee).

QSize AdjustToMinHeightDelegate::sizeHint() const
{
    static const int minItemHeight(36);

    const QSize size = QStyledItemDelegate::sizeHint();
    return QSize( size.width(), qMax( size.height(), minItemHeight) );
}

Cheers,
Tim

--
An Apple a day keeps Windows away

ACCU - http://www.accu.org - Professionalism in Programming.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090517/e6e4cd1d/attachment.html 


More information about the Qt-interest-old mailing list