[Development] QWidget::setWindowState(Qt::WindowStates) vs QWindow::setWindowState(Qt::WindowState)

Thomas S√łndergaard thomas.sondergaard at karoshealth.com
Wed Jan 18 16:21:19 CET 2017

I hope my previous email wasn't offensive or downright stupid; no one has
replied. I certainly meant no disrespect. While I'm waiting for a response,
let me throw a specific proposal out there.

First, I assume the correct solution is to extend QWindow and
QPlatformWindow so they can deal with compound states such as
Qt::WindowMaximized|Qt::WindowMinimized, just like QWidget can. Since
QWindow::setWindowState(Qt::WindowState) and Qt::WindowState
QWindow::windowState() cannot be modified, I'm thinking of adding

Qt::WindowStates QWindow::fullWindowState() const;
void QWindow::setFullWindowState(Qt::WindowStates);


Qt::WindowStates QPlatformWindow::fullWindowState() const;
void QPlatformWindow::setFullWindowState(Qt::WindowStates);

The existing QWindow::windowState() would then be implemented using the
effectiveState() function from qwidget.cpp (I'd move it over)

I can experiment with these changes and implementing them in the xcb and
windows platform plugins, but early feedback is always great, so I avoid
wasting time.

Thanks for making Qt


On 17 January 2017 at 21:37, Thomas S√łndergaard <
thomas.sondergaard at karoshealth.com> wrote:

> Hi,
> I'm looking at the Qt code with intention to fix it so this code
>     QWidget widget;
>     widget.setWindowState(Qt::WindowMaximized);
>     widget.showMinized();
> will show the window iconified and when the user (or program) unminimize
> the window it pops up maximized. This is currently not possible (
> QTBUG-57882 <https://bugreports.qt.io/browse/QTBUG-57882>).
> I've been trying to read the Qt code and it seems to me the problem is
> that QWindow::setWindowState(Qt::WindowState) and QPlatformWindow::
> setWindowState(Qt::WindowState) only take a Qt::WindowState argument not
> a Qt::WindowStates argument. This seems to make it impossible to set the
> correct state on the windows-system window.
> Is this intentional or a known issue?
> I would be happy to get suggestions for how this is best fixed.
> Best regards,
> Thomas


Thomas Sondergaard | karoshealth

Product Architect

M: +45 5157 3090 | Skype: tsondergaard

Krumtappen 4, 3rd floor

DK-2500 Valby, Denmark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170118/534117dd/attachment.html>

More information about the Development mailing list