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

QtMacExtras's QMacNativeToolBar doesn't provide a way to add an NSView-based toolbar item

    XMLWordPrintable

Details

    Description

      In Qt 4, I could create a toolbar with Mac-style "unified" appearance, then use setStyleSheet() to further customize the appearance of toolbar items. For example, see the attached image — I added 3 actions with custom styles to create the "Zoom" part of the toolbar.

      In Qt 5, I tried using QtMacExtras::setNativeToolBar(), but my styles are ignored (which makes sense since it's rendering using a Cocoa widget instead of Qt code).

      It would be great if there were a way to add an NSView to a QMacNativeToolBar.

      I've attached the beginnings of a patch. It makes QMacToolButton public, and adds the constructor QMacToolButton::QMacToolButton(NSView *view, QAction *action) and other infrastructure... But it isn't quite working yet.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            smokris Steve Mokris
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes