Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Hand cursor vs arrow pointer in QGraphicsView



  • After setting "setDragMode(QGraphicsView::ScrollHandDrag)", the cursor is set permanently to a hand while over the graphicsview. I thought that the correct mode was to turn the cursor to a hand only when the left mouse button is pressed. I'd prefer the latter mode of operation, if possible. Is there any way to correct this?


  • Moderators

    @StringTheory said in Hand cursor vs arrow pointer in QGraphicsView:

    I thought that the correct mode was to turn the cursor to a hand only when the left mouse button is pressed.

    it's clearer for the user to show the possibility to drag by mouse before he starts dragging. That's the reason i guess.

    But if you want you can implement the scrolling yourself. Shouldn't be that hard.
    Just handle the mouse press/move/release events and use QGraphicsView::scrollContentsBy() and scroll by the delta of the position of last mouse-move event.



  • Ah, so it's normal operation. I wasn't sure if I had caused it. I don't remember seeing any other program operate in this fashion, but I understand the reasoning.

    I've been considering handling mouse/cursor ops, but I was hoping to put that off til later. As a quick fix, maybe I could set ScrollHandDrag only when the mouse button is down. Not sure if that would work though.


Log in to reply