My goal is to have a Tableview that has 2 specific things:
Thing #1:
1.1 Left mouse button UP behaviour:
When I press with the left mouse button and hold it on the view with rows and columns and move the mouse UP
=> I want to see the "QScroller::grabGesture" behaviour, it means that - the table moves down,
and the slider on the scrollbar also moves down, while the mouse coursor with the pressed left button moves UP.
1.2 Left mouse button DOWN behaviour:
When I press with the left mouse button and hold it on the view with rows and columns and move the mouse DOWN
=> I want to see the "QScroller::grabGesture" behaviour, it means that - the table moves up,
and the slider on the scrollbar also moves up, while the mouse coursor with the pressed left button moves DOWN.
Thing #2:
When I press with the left mouse button and hold it on the SLIDER and move the mouse up or down
=> I want to turn the "QScroller::grabGesture" behaviour OFF, and use the slider in his "default" mode, - if I move the slider down then the table moves down and if I move the slider up then the table moves up.
------------------------
In my sample project QtWgtScrollerTestApp I achieve that. But I came across some problems:
#1 Problem:
I need to wait some time (around 200 or 400 milliseconds) after I press on the Slider for the signal QScrollBar::sliderPressed to be emited.
If I start to move the mouse at the same time when I press on the slider, sliderMoved signal emits earlier and sliderPressed seems not to be emited at all after that.
#2 Problem:
When I start my app, and right away CLICK (press and release) with the left mouse button on the slider I am getting a "Segmentation fault" somewhere in a qmap source code
Qt Code:
const QMapNodeBase *QMapNodeBase::nextNode() const { const QMapNodeBase *n = this; if (n->right) { n = n->right; while (n->left) // <- "Segmentation fault" line n = n->left; } else {To copy to clipboard, switch view to plain text mode
QUESTION:
What is the correct way to achieve the behavior for a tableview and the slider that I want and have discribed above (with Thing #1 + Thing #2) ?
If my sample project is generally correct, how do I get ridd of the 2 problems described above ?
Or at least how to avoid the "Segmentation fault" problem in my project ?
Bookmarks