Or you can resize your window to limits on resizeEvent![]()
Or you can resize your window to limits on resizeEvent![]()
Yes, I have already tried working with the resizeEvent and maximization.
Thank you for the hints.
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
Ok,
Last question:
I can implement my own resizeEvent(..), but I can't call the resize() or setGeometry() in the event due to infinite recursion, am I right?
Howto set the size in the resize event then?
I can get the old size and new size, set old width and only update the height. But which method to use inside resizeEvent?
Thank you
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
would this make sense? I get a recursion here(resizeEvent body)
Qt Code:
if(oldSize!=newSize) { resize(oldSize.width(),newSize.height()); event->accept(); } event->ignore();To copy to clipboard, switch view to plain text mode
I am also looking for a signal to detect maximization. Is there any signal connected with this action? Should I overide the "showMaximixed()" slot in my mainwindow?
How to detect the maximize action?
THANK YOU
Last edited by maverick_pol; 22nd May 2009 at 10:13.
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
Not really. You have to calculate the new-new-size yourself and compare it to the new-size that you get from the event.
Yes, you can do that this way, but it will only work if someone calls showMaximized() and not when an appropriate button on the window's decoration is used.I am also looking for a signal to detect maximization. Is there any signal connected with this action? Should I overide the "showMaximixed()" slot in my mainwindow?
How to detect the maximize action?
Hi,
Thank you for the detailed explaination. This is my last question:
How to detect the maximize button click ?
Thank you
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
I guess you'd have to listen for native events but I can't guarantee there is one sent on each of the supported platforms.
You can override winEvent of your widget, and modify the size there.
I remember seeing a code where they had done something like this. You will need to modify the MSG structure parameters
Bookmarks