hi,
Resizing window is a continuous process -
mouse down, drag drag drag .. , mouse up
It seems that any dragging can invoke a resizing event.
Does Qt exist an event at the end of resizing ?
Thank your for any reply.
Printable View
hi,
Resizing window is a continuous process -
mouse down, drag drag drag .. , mouse up
It seems that any dragging can invoke a resizing event.
Does Qt exist an event at the end of resizing ?
Thank your for any reply.
It's not that stright forward to say continuous, it is actualy invidual mouse movement events triggering resizeEventQuote:
Resizing window is a continuous process -
Each resizeEvent by itself is the indication that widget should resize now. There is not concept of last event/end of resize.
In short No.
You can use a singleshot QTimer to trigger something if a resizeEvent has not been received for a certain period, say 500 milliseconds. This is approximately "the end of resizing"
Code:
#include <QtGui> #include <QDebug> Q_OBJECT public: m_resizeTimer.setSingleShot(true); connect(&m_resizeTimer, SIGNAL(timeout()), SLOT(resizeDone())); } protected: qDebug() << Q_FUNC_INFO; m_resizeTimer.start(500); } private slots: void resizeDone() { qDebug() << Q_FUNC_INFO; } private: QTimer m_resizeTimer; }; int main(int argc, char**argv) { Widget w; w.show(); return app.exec(); } #include "main.moc"
oh ... I never think about it. Thank your replay :D