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

[Mac Regression] Qt::Popup doesn't work correctly with other Qt::WindowFlags

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 5.5.1, 5.9.2
    • None
    • Mac OSX 10.9.4, Qt 5.4-dev

      macOS 10.12.6 tested with Qt 5.9.2
    • macOS

    Description

      I have a QDialog widget on which I set the following window flags:

      _popupDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint | Qt::Popup);
      

      I also enable the size grip for the dialog.

      When I show that dialog using Qt 4, I get a popup dialog with a title bar and a size grip. Using Qt 5 (I have only tested 5.4-dev) I get a window without a title bar that is not resizable.

      I have attached screenshots showing this behavior and I've attached a sample application that demonstrates the problem.

      I have also attached a screenshot of an example of how we are using this kind of widget in our application. The ability to move and resize this popup window is important in our application. The screenshot was taken using Qt 4.8.6.

      This incorrect behavior appears to come from QCocoaWindow::windowStyleMask(Qt::WindowFlags flags) in qcocoawindow.mm where there is this code:

          if ((type & Qt::Popup) == Qt::Popup) {
              if (!windowIsPopupType(type))
                  styleMask = (NSUtilityWindowMask | NSResizableWindowMask | NSClosableWindowMask |
                               NSMiniaturizableWindowMask | NSTitledWindowMask);
          } else {
      

      The net effect is that all Qt::WindowFlags set on the window via QWidget::setWindowFlags() are ignored if the window's type is Qt::Popup.

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            aclight Adam Light
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes