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

[macOS] QMacToolBar API works incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.13.2, 5.14.1
    • Widgets: Main Window
    • None
    • macOS 10.14
    • macOS

    Description

      all QMacToolBarItem elements MUST be added to the toolbar BEFORE calling attachToWindow, which is not logical and nowhere documented. If you try to add items after attachToWindow it won't work.

      QMacToolBar *toolBar = new QMacToolBar(this);
      QMacToolBarItem *toolBarItem = toolBar->addItem(QIcon(), QStringLiteral("foo"));
      connect(toolBarItem, SIGNAL(activated()), this, SLOT(fooClicked()));
      
      this->window()->winId(); // create window->windowhandle()
      toolBar->attachToWindow(this->window()->windowHandle());
      
      QMacToolBarItem *toolBarItem2 = toolBar->addItem(QIcon(), QStringLiteral("second")); // won't be visible!
      
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            crystalidea Steven (crystalidea)
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes