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

XCB: isMinimized() returns wrong status

    XMLWordPrintable

Details

    • 382b7afbe253c29499631066bbe1091f0afbd386

    Description

      isWindow()returs false even in case window is already minimized. Actually After each WindowStateChange Qt::WindowMinimized, it automatically fires previous window State which negates the actual state.

      Following example can shows it. You can see two output for every minimize event.

      #include <QtWidgets>
      
      static QString windowStateString(Qt::WindowStates states)
      {
          QStringList str;
          if (states & Qt::WindowMinimized)
              str += "Qt::WindowMinimized";
          if (states & Qt::WindowMaximized)
              str += "Qt::WindowMaximized";
          if (states & Qt::WindowFullScreen)
              str += "Qt::WindowFullScreen";
          if (states & Qt::WindowActive)
              str += "Qt::WindowActive";
          if (states == Qt::WindowNoState)
              str += "Qt::WindowNoState";
          return str.join(",");
      }
      
      class Window : public QWidget
      {
      protected:
          void changeEvent(QEvent *event)
          {
              QWidget::changeEvent(event);
              if (event->type() == QEvent::WindowStateChange){
                  setWindowTitle(windowStateString(windowState()));
                  qDebug()<<isMinimized();
              }
          }
      };
      
      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
          Window w;
          w.showMaximized();
          return app.exec();
      }
      
      

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              qtcomsupport Qt Support
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes