PDA

View Full Version : internal QListView update messes up custom scrollbar stepsize



so Qt
29th October 2015, 18:32
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

so Qt
31st October 2015, 16:21
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?