PDA

View Full Version : QSizeGrip dissappears



Debra
18th July 2019, 21:25
I am using QSizeGrips on two internal frames. They work fine until I maximize the main window; Then the grips disappear. In the documentation (https://doc.qt.io/qt-5/qsizegrip.html) it states "On some platforms the size grip automatically hides itself when the window is shown full screen or maximised." I guess I am using a platform that hides the grips - I'm using Qt 5.9.1 in a Linux environment. Is there anyway to force the grips to appear even when the main window is maximized? I was going to use QPushButtons as an alternative, but I like the grips much better.
Thanks for your help!

Ginsengelf
19th July 2019, 07:19
Hi, I think this is the behaviour of pretty much any platform I've used.
A window can be either maximized or exist as window that can be resized freely. So a maximized window is not the same as a window that has been resized to fill all space (for example on Windows 7 maximizing subtly changes the title bar).

Ginsengelf

anda_skoa
19th July 2019, 09:34
QSizeGrip does this "autohide" in its event filter, see https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qsizegrip.cpp.html#_ZN9QSizeGrip11eventFilterEP7QO bjectP6QEvent

If you install your own event filter on the size grips that filters out the WindowStateChange signal, over derive from QSizeGrip and reimplement eventFilter() such that it does nothing, then they should always remain visible.

Cheers,
_

Debra
22nd July 2019, 20:39
Dear anda_skoa, Thanks!!! That is exactly what I was looking for.

Added after 8 minutes:

Dear Ginsengelf, That is true. I would try to implement a "fill all space" version, if there were not other possibilities. Thank you for responding to my question.