is showMaximized() guaranteed to show the window?



  • Is showMaximized() guaranteed to at least show the window on all desktop operating systems?
    Is it possible to determine if it failed in any way (via code)?

    Nor does X11 provide a way to maximize a window. QWidget::showMaximized() has to emulate the feature. Its result depends on the result of QWidget::frameGeometry() and the capability of the window manager to do proper window placement, neither of which can be guaranteed.

    http://doc.qt.io/qt-5/application-windows.html


  • Moderators

    Hi!

    Is showMaximized() guaranteed to at least show the window on all desktop operating systems?

    Looking at void QWidget::showMaximized() in qwidget.cpp I would say 'yes' because setVisible(true) is called no matter happens before.

    Do you know any desktop environment where showMaximized doesn't work?



  • @Wieland Thanks for the help and the link.

    Do you know any desktop environment where showMaximized doesn't work?

    No I do not. I'm contributing to an open source project so I want to be sure.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.