[Qt-interest] How to widen a scroll bar of viewList?

Tom Panning lurchvt at gmail.com
Thu Jul 2 15:43:37 CEST 2009


Kermit,

The only way that I know of is somewhat roundabout, but both problems
are solvable.

To make the scroll bar wider, you can set a custom style that returns
a larger number from QSytle::pixelMetric() for the PM_ScrollBarExtent
PixelMetric.

To make the items of a QListView taller, you need to create a subclass
of QItemDelegate that returns a larger size for
QItemDelegate::sizeHint(). Then you need to call setItemDelegate() on
your list view. I haven't tried this with tables, but it should work
there too.

If you're making these items larger, you should look through the other
PixelMetric types and see if there's anything else you want to make
larger. Note that some things are drawn with a pixmap, so they may
look blockier when they are made larger.

Tom

On Thu, Jul 2, 2009 at 2:04 AM, Kermit Mei<kermit.mei at gmail.com> wrote:
> Hello, how can I widen a scroll bar, and widen the hight of the rows of
> a QListView of QTableView object?
>
> Thanks.
>
> Kermit Mei
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list