PDA

View Full Version : QListWidget with scroll fade out feature



MinMin
28th April 2014, 10:51
Hi,
I have a listwidget of images in icon mode. When there are many icons, the vertical scroll bar appears. Instead of that, I want the scroll bar to be invisible and there are fading area at top and bottom of the list to indicate more images(if any).
I set the vertical bar off alr.


listView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff) ;

But i dont know how to implement the fade out effect. Any suggestions?
Thanks,

high_flyer
28th April 2014, 11:31
This is not trivial, but also should not be very hard to do.
Basically it means you will have to implement your own scrollbar widget with translucency.
There might be various ways to do it.
A good place to start might be here:
http://qt-project.org/doc/qt-4.8/qwidget.html#transparency-and-double-buffering
once you have an idea going, ask again for for finer pointers.

anda_skoa
28th April 2014, 13:26
If those indicator areas are supposed to be on top and at the bottom of the list, then putting them into the view's contents margins might work.

Cheers,
_