Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30085

QWidget::isMaximized() does not work as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P2: Important P2: Important
    • None
    • 5.0.1
    • None
    • Windows 7 SP1 , 64bit, Visual Studio 2010 Professional, Qt 5.0.1 for msvc2010

      The method QWidget:isMaximized() does not work as expected.

      QWidget:isMaximized() seems to return the inverted result. A maximized widget (e.g. a QMainWindow) returns false and a minimized one true.

      To illustrate this behaviour a QtCreator project is attached. The project consists of a simple QMainWindow overriding the resizeEvent method as follows:

      maximized.cpp
      void Maximized::resizeEvent(QResizeEvent * resizeEvent)
      {
          const QString max = isMaximized() ? "true" : "false";
      
          ui.label_max->setText(QString("maximized: %1").arg(max));
      }
      

      The resize event sets one label's text inside the widget presenting the current result of isMaximized(). By compiling and executing this project you can see a maximized widget will result in false and a minimized in true.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            srutledg Shawn Rutledge
            derhandwerk Wolf Bublitz
            Votes:
            7 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes