Results 1 to 2 of 2

Thread: internal QListView update messes up custom scrollbar stepsize

  1. #1
    Join Date
    May 2015
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default internal QListView update messes up custom scrollbar stepsize

    We've subclassed QListView and set a custom stepsize on its scrollbars by catching the rangeChanged signal from the bars itself. We also support item sorting by implementing custom drag and drop handlers. If we change the sorting in our view though, the widgets internally update themselves (handling a HoverEvent) and override the scrollbar stepsize with a default value that's calculated during these internal update routines. Unfortunately the rangeChanged signal isn't emmitted in this case because the scrollbar range or respectively the amount of items didn't change.
    Is there a way to a) either prevent the scrollbar default update or b) override the internally calculated value with our own after the update has occurred?

    Thanks
    Last edited by so Qt; 29th October 2015 at 19:37.

  2. #2
    Join Date
    May 2015
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: internal QListView update messes up custom scrollbar stepsize

    Ok, found a solution myself: I just had to overwrite updateGeometry in my subclass and set my custom stepsize afterwards once again. The only issue I have with this is that this function isn't declared virtual in its defining base class. Can this be a problem? Cause when my widget's udpateGeometry is called vis base class, the wrong method is called, right?

Similar Threads

  1. QListView/QAbstractItemView and list internal drag & drop
    By Infinity in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2014, 17:37
  2. When update for background-image on scrollbar ?
    By Alundra in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2014, 21:35
  3. qlistview and scrollbar problem
    By melody:p in forum Qt Programming
    Replies: 2
    Last Post: 4th November 2013, 03:59
  4. Qlistview scrollbar invalid on windows
    By wushaowen in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2011, 03:16
  5. QListView's scrollbar stylesheet
    By luochen601 in forum Qt Programming
    Replies: 4
    Last Post: 9th September 2010, 07:34

Tags for this Thread

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.