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

Mac: After calling showNormal() on a fullscreen window the window does not have focus anymore

XMLWordPrintable

    • macOS

      The window looses focus after it is shown in full screen and then calling showNormal().

      It would be expected that the window would be in focus after this call.

      Reproducible with:
      #include <QtGui>
      #include <QDebug>

      class CustomWidget : public QPushButton
      { Q_OBJECT
      public:

      QMainWindow * m;
      CustomWidget(QWidget* parent=0) : QPushButton(parent)

      { connect(this,SIGNAL(clicked()), this, SLOT(aSlot())); }

      public slots:
      void aSlot()

      { qDebug() << "aSlot invoked"; m->showNormal(); }

      };

      #include "main.moc"

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

      CustomWidget wid;

      QMainWindow m;
      wid.m = &m;
      QPushButton b("button...", &m);
      m.setCentralWidget(&b);

      QObject::connect(&b, SIGNAL(clicked()), &wid, SLOT(aSlot()));
      m.show();
      m.showFullScreen();
      return app.exec();
      }

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

            bjnilsen Bjørn Erik Nilsen
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes