Rectangle Item stops getting hover events
-
I am trying to create kind of a pixel art drawing program and I'm using QGraphicsView for the canvas. I have a rectangle item for every pixel (it's gonna be zoomed in). I have overrided the mouse hover event on the rectangle items but when I hold my left mouse button down, the rectangles stop getting mouse hover events. Does anyone have an idea why this could be happening?
-
@Forfunckle said in Rectangle Item stops getting hover events:
How can I implement a mouse press - mouse move event system?
Override https://doc.qt.io/qt-5/qwidget.html#mousePressEvent, https://doc.qt.io/qt-5/qwidget.html#mouseReleaseEvent and https://doc.qt.io/qt-5/qwidget.html#mouseMoveEvent
Also set https://doc.qt.io/qt-5/qwidget.html#mouseTracking-prop
Example: https://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html -
@Forfunckle You get mouse hover event if you move the mouse cursor over the item. If you press and hold left mouse event you should get mouse press and mouse move events. Why do you need mouse hover event with pressed down left mouse button?
-
Hi, I would like to have the ability to drag the mouse while keeping it pressed in order to draw on the canvas. How can I implement a mouse press - mouse move event system?
-
@Forfunckle said in Rectangle Item stops getting hover events:
How can I implement a mouse press - mouse move event system?
Override https://doc.qt.io/qt-5/qwidget.html#mousePressEvent, https://doc.qt.io/qt-5/qwidget.html#mouseReleaseEvent and https://doc.qt.io/qt-5/qwidget.html#mouseMoveEvent
Also set https://doc.qt.io/qt-5/qwidget.html#mouseTracking-prop
Example: https://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html