zxlive icon indicating copy to clipboard operation
zxlive copied to clipboard

QEvent.ignore

Open jvdwetering opened this issue 1 year ago • 0 comments

I see there's a bunch of places in the code where an event is captured but not used (for instance because the right mouse button is not used). If I understand correctly, in this case you should call QEvent.ignore() (https://doc.qt.io/qt-5/qevent.html#ignore) in order to allow Qt to propagate the event to the parent. This will probably prevent future bugs. So for instance the current mousePressEvent is implemented as

def mousePressEvent(self, e: QGraphicsSceneMouseEvent) -> None:
        super().mousePressEvent(e)
        if e.button() != Qt.LeftButton:
            return
        ...

I think here before the return, you should be calling e.ignore().

jvdwetering avatar Jun 05 '23 20:06 jvdwetering