Skip to content

QwtPlot.setMouseTracking is ignored #88

Open
@ZeeD

Description

@ZeeD

I want to detect the mouse move events over my qwt plot.

According to mouseMoveEvent docs:

If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed.

To enable the mouse tracking it should be enough to invoke setMouseTracking(True) but it seems to me that it is ignored.

from qwt.plot import QwtPlot
from PySide6.QtGui import QMouseEvent

class MyPlot(QwtPlot):
    def __init__(self) -> None:
        super().__init__()
        self.setMouseTracking(True)
    def mouseMoveEvent(self, event: QMouseEvent) -> None:
        print(event) # dummy implementation

I see the events in the stdout only if I keep the mouse button pressed, not just on "hovering" over the plot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions