Is there a way to detect when a window is resized by a user from _start_ of resizing (holding mouse button down) to the end of resize (releaseing mouse press). I'd like to do some things during resize.
Is there a way to detect when a window is resized by a user from _start_ of resizing (holding mouse button down) to the end of resize (releaseing mouse press). I'd like to do some things during resize.
If the window manager doesn't do non-opaque resizing then no. If it does, you'll be getting resizeEvent() calls in your widgets. Otherwise you'll get the event just once when resizing is complete.
ok, thanks. Dziekuje
I tried to capture mousepress event but it looks like it is not fired on window border (where the resize starts)
Window title bar is not part of the application and furthermore pressing the mouse on the title bar is not the only way to resize a window.
What is the goal that you wish to achieve?
My goal is to disable executing some parts of code execution during resize. Or on the other hand I may want to draw something else on the screen during resize of window. "During resize" I mean time when user has mouse pressed down on window border and moving the window. I also would need to know when resize is finished - mousebutton is released. Currently QWidget::resize() event is fired wheneven mouse is moved even a little.
I am going to try this by finding out if resize event is called when mouse button is pressed. Then I can be quite certain windows is being resized. When mouse button is released then resizing is stopped.
Qt Code:
QTimer resizeTimer; resizeTimer.setSingleShot( true ); connect( &resizeTimer, SIGNAL(timeout()), SLOT(resizeDone()) ); { resizeTimer.start( 500 ); } void MainWindow::resizeDone() { // Something doing }To copy to clipboard, switch view to plain text mode
phenoboy (2nd October 2013)
Bookmarks