[Qt-interest] touch screen friendly qtlistbox scrollbar

Tim W timpie.w at gmail.com
Sun Mar 22 20:27:38 CET 2009


On Sun, Mar 22, 2009 at 12:23 PM, Bastiaan Naber <bastiaannaber at gmail.com>wrote:
>
>
> What I would like even more is that the listbox wouldn't have a scrollbar
> but
> it could be pushed up and down with a press of the finger on the list and
> than moving up / down (like all the nice touch screen phone interfaces). I
> have seen a movie of Qt Extended in which this behavior is implemented, is
> there any way of getting it into the normal Qt as well?
>


Used it a few years ago but have a look at QStyle::pixelMetric and
PM_ScrollBarExtent.
Try someting like this:

int CustomStyle::pixelMetric(
PixelMetric<http://doc.trolltech.com/3.3/qstyle.html#PixelMetric-enum>
metric,
const QWidget <http://doc.trolltech.com/3.3/qwidget.html> * widget ) const
{
    if( metric==QStyle::PM_ScrollBarExtent )
        return 50;
    else
        return QStyle::pixelMetric(metric, widget);
}


Cheers,
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090322/e345556e/attachment.html 


More information about the Qt-interest-old mailing list