QTableView Vertical scroll bar speed
-
Hello,
I want to get more control on the scrollbar which is part of tableview.
There are multiple questions -
-
When the up arrow or down arrow key pressed, I would like to get the release event to perform some operations. How can I get it?
-
I want to control the scrolling speed. Meaning, when I press and hold the scrollbar up or down arrow, I see that the table rows are scrolling at the defined speed. I want to control that and reduce the speed, for example, 3 rows per second. How can I do that?
-
What does the SliderNoAction means? When does this event occurs?
Thanks,
Kumara -
-
Hi,
- Either implement an event filter or subclass QScrollBar and reimplement keyReleaseEvent
- The pageStep property is a starting point but if you want rather a time based scrolling, you'll have to implement your own scroll bar.
- That's not an event per se. In any case, AFAIK, it's used by Qt for the repeat action.
-
@SGaist Thanks for the answers Sam!
Answer for 1st, I have implemented and it works cool!
-
Implementing my own scroll bar, hmm, I dont want to go through the whole pain that Qt took for implementing this. I wish Qt provides interface to manage this. But, when I took a quick look at the source code, it looks like, there is no speed management implemented.
-
Thanks for the information. But, if this is internal to Qt, why should they show it for end user, it confuses a bit. At a moment, I thought that, when slider is operated and user has now stopped operating, NoAction would be generated. But that is not correct as you mentioned.
-
-
- AFAIK, there's not indeed
- It's not internal, what I was showing is the use of that enum value in Qt's own code.
-
Thanks for the answers Sam!