Results 1 to 2 of 2

Thread: Tableview with grabGesture but it's slider should work with non-grabGesture logic

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2021
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Question Tableview with grabGesture but it's slider should work with non-grabGesture logic

    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:
    1. const QMapNodeBase *QMapNodeBase::nextNode() const
    2. {
    3. const QMapNodeBase *n = this;
    4. if (n->right) {
    5. n = n->right;
    6. while (n->left) // <- "Segmentation fault" line
    7. n = n->left;
    8. } 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 ?
    Attached Files Attached Files
    Last edited by omnio2006; 4th February 2021 at 14:27.

Similar Threads

  1. Replies: 4
    Last Post: 22nd September 2010, 22:34
  2. Replies: 5
    Last Post: 21st September 2010, 19:16
  3. Replies: 2
    Last Post: 4th September 2010, 06:18
  4. Replies: 2
    Last Post: 21st March 2010, 09:01
  5. need help in getting a logic to work
    By eva2002 in forum General Programming
    Replies: 3
    Last Post: 29th January 2010, 08:30

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.