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

QtMacExtras: Add APIs to Set the ToolTip of a Button

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.3.0
    • Extras: Mac
    • None
    • OS X 10.9 with Xcode 5.0.2

    Description

      Currently, QtMacExtras does not support setting the tooltips of the buttons.

      I am attaching a patch that implements this functionality:

      src/macextras/qmacnativetoolbar.mm | 4 ++--
      src/macextras/qmacnativetoolbar_p.h | 2 +-
      src/macextras/qmactoolbardelegate.mm | 11 +++++++++++
      src/macextras/qmactoolbardelegate_p.h | 1 +
      src/macextras/qmactoolbutton.mm | 10 ++++++++++
      src/macextras/qmactoolbutton_p.h | 4 ++++

      In particular, QMacToolButton stores the tooltip. QMacNativeToolBar's addAction(QIcon, QString) has gained a new parameter for the toolTip (initialized with an empty string) [1]. QMacToolbarDelegate's toolbar: method (invoked by Cocoa) checks whether a button has a tooltip, and if so, sets the toolTip using the NSToolBarItem's setToolTip: method.

      [1] You may want to add a new override instead of a default-initialized parameter. Not sure what the Qt-preferred way is.

      Attachments

        Activity

          People

            sorvig Morten Sørvig
            philipb Philip Belemezov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: