Results 1 to 3 of 3

Thread: QListWidget with scroll fade out feature

  1. #1
    Join Date
    Mar 2014
    Posts
    4
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default QListWidget with scroll fade out feature

    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.

    Qt Code:
    1. listView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QListWidget with scroll fade out feature

    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/qwi...uble-buffering
    once you have an idea going, ask again for for finer pointers.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    MinMin (29th April 2014)

  4. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QListWidget with scroll fade out feature

    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,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    MinMin (29th April 2014)

Similar Threads

  1. Implementing fade-in / fade-out for a modal QDialog
    By d_stranz in forum Qt Programming
    Replies: 3
    Last Post: 30th October 2013, 07:11
  2. QGraphicsView scroll fade out
    By Cruz in forum Qt Programming
    Replies: 1
    Last Post: 30th September 2013, 10:03
  3. Customising the scroll bar in a QListWidget
    By balasaravanan in forum Qt Programming
    Replies: 1
    Last Post: 4th March 2011, 07:57
  4. Problems with scroll in QListWidget
    By VilmarCeller in forum Qt Programming
    Replies: 1
    Last Post: 16th December 2010, 10:54
  5. Replies: 0
    Last Post: 28th December 2009, 12:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.