How I can know when a button has been resized?
Thanks.
Printable View
How I can know when a button has been resized?
Thanks.
You could use an event filter, if you have a MainWindow class for example:
In the constructor, I put:
Code:
{ setCentralWidget(_button); _button->installEventFilter(this); }
This way, MainWindow will receive all events sent to the button. The definition for eventFilter() could look like:
Code:
{ qDebug() << "button was resized!"; } }
You could also extend QPushButton and emit a signal when a resize event occurs. It all depends on your particular use-case.
Thanks, this is what I needed.