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

Window minimizing broken after building QT app with Mac OS High Sierra SDK

    XMLWordPrintable

    Details

    • Platform/s:
      macOS

      Description

      I have a frameless Qt app setup with setWindowFlags (Qt::Window | Qt::FramelessWindowHint) and custom minimize and close buttons. I'm having trouble minimizing the app by using setWindowState(Qt::WindowState::WindowMinimized) or showMinimized() and the 10.13 SDK. It worked fine on Mac with the 10.12 SDK. I also tested this with a new clean project with no special eventFilters or similar. Anyone else with this problem? I'm using Qt 5.10.0, this problem also appeared in Qt 5.9.1.

      I'm just doing this in my MainWindow which works with the 10.12 SDK.

      MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
          //remove native OS-titlebar
          setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
          
          QPushButton* minimizeButton = new QPushButton();
          minimizeButton->setText(QLatin1String("Minimize"));
          connect(minimizeButton, &QPushButton::clicked, this, &QMainWindow::showMinimized);
          
          QPushButton* quitButton = new QPushButton();
          quitButton->setText(QLatin1String("Close"));
          connect(quitButton, &QPushButton::clicked, this, &QMainWindow::close);
          
          QHBoxLayout* layout = new QHBoxLayout();
          layout->addWidget(minimizeButton);
          layout->addWidget(quitButton);
          
          QWidget *centralWidget = new QWidget();
          centralWidget->setLayout(layout);
          setCentralWidget(centralWidget);
      }
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              knappsas Sascha Knapp
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes