qtqt4pyqtpyqt4

QWidget resize signal?


I want to take an action when a widget was resized.

Is there a way to catch that without installing an event filter on that widget (and, obviously, without subclassing it)? AFAIK, QWidget does not have a resized signal.


Solution

  • If you have any other QObject that can have strict relation to that QWidget you may use QObject::installEventFilter(QObject * filter) and overload bool eventFilter(QObject *, QEvent *). See more at Qt docs