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

Unified toolbar becomes black when adding a WA_NativeWindow widget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • None
    • 5.3.1, 5.3.2
    • Widgets: Main Window
    • None
    • Mac OS X 10.9.4
    • macOS

    Description

      This is critical for me as I'm using QMacCocoaViewContainer inside the toolbar which AFAIK is always a "native widget".

      Here's a minimal test case:

      #include <QApplication>
      #include <QMainWindow>
      #include <QToolBar>
      #include <QLabel>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow w;
          w.setUnifiedTitleAndToolBarOnMac(true);
          QToolBar *bar = new QToolBar();
          QLabel *l = new QLabel("Test");
          l->setAttribute(Qt::WA_NativeWindow);
          bar->addWidget(l);
          w.addToolBar(bar);
          w.show();
          return a.exec();
      }
      

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            flaviotordini Flavio Tordini
            Votes:
            9 Vote for this issue
            Watchers:
            16 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes