Qt: How to capture mouse movement in QVideoWidget?

Viewed 30

I tried this but this doesn't track the mouse movement unless a button is pressed:

from PySide6 import QtWidgets as qtw
from PySide6 import QtMultimediaWidgets as qtmw


app = qtw.QApplication()

vw = qtmw.QVideoWidget()
vw.setMouseTracking(True)
vw.mouseMoveEvent = lambda *x: print(1)
vw.show()

app.exec()

On other widgets, I would setMouseTracking(True) for the .viewport(), but it doesn't look like QVideoWidget has a viewport.

0 Answers
Related