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

QSizeGrip doesn't appears on the QStatusBar if the window is shown with showMaximize()

    XMLWordPrintable

Details

    • 10221602edb39b7c7ed9e0c9608f64a539adcdec

    Description

      The size grip will not be visible even if the user un-maximize the window.

      #include <QtGui/QtGui>

      int main(int argc, char *argv[]) {

      QApplication app(argc,argv);
      QMainWindow *main = new QMainWindow;
      QStatusBar *statusbar = new QStatusBar;
      statusbar->setSizeGripEnabled(true);
      QLabel *label1 = new QLabel("Label 1 ...");
      QLabel *label2 = new QLabel("Label 2 ...");
      QLabel *label3 = new QLabel("Label 3 ...");
      statusbar->addWidget(label1, 0);
      statusbar->addWidget(label2, 0);
      statusbar->addWidget(label3, 1);
      main->setStatusBar(statusbar);
      // main->show();
      main->showMaximized();
      return app.exec();
      }

      The reason is that in QSizeGripPrivate::init the top level window is not correctly set yet, so the eventFilter is not installedon the right widget.

      Workaround is to create the statusbar with the main window as a parent.

      Attachments

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

        Activity

          People

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes