diff options
author | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-09-14 13:36:06 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-09-15 14:52:26 +0000 |
commit | 43d935aa2d0fd5749fea717d4aa576cf52a05c5a (patch) | |
tree | 821badf9029a7f42f07f1e31e4d22c99020e2b63 /src/widgets | |
parent | 1f925d47e9f28e78f0b96dc8a6fd8ed8fde88070 (diff) |
QMenuBar: improve documentation of the D-Bus unified menu bar
Since 5.7.0 this is not just a macOS feature. It's also not necessarily
limited to Ubuntu Unity, since the specification is open, and there's
work in progress to implement it on KDE.
Also fixed a couple of typos.
Task-number: QTBUG-54793
Change-Id: Idbc68ddafff4dea30649e634ca29f10703f60d3b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qmenubar.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index b6597df47c..0e7b25f65d 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -616,9 +616,10 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti for items in the menu bar are only shown when the \uicontrol{Alt} key is pressed. - \section1 QMenuBar on \macos + \section1 QMenuBar as a Global Menu Bar - QMenuBar on \macos is a wrapper for using the system-wide menu bar. + On \macos and on certain Linux desktop environments such as + Ubuntu Unity, QMenuBar is a wrapper for using the system-wide menu bar. If you have multiple menu bars in one dialog the outermost menu bar (normally inside a widget with widget flag Qt::Window) will be used for the system-wide menu bar. @@ -661,11 +662,16 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti as its parent. That menu bar would only be displayed for the parent QMainWindow. - \b{Note:} The text used for the application name in the menu + \b{Note:} The text used for the application name in the \macos menu bar is obtained from the value set in the \c{Info.plist} file in the application's bundle. See \l{Qt for macOS - Deployment} for more information. + \b{Note:} On Linux, if the com.canonical.AppMenu.Registrar + service is available on the D-Bus session bus, then Qt will + communicate with it to install the application's menus into the + global menu bar, as described. + \section1 Examples The \l{mainwindows/menus}{Menus} example shows how to use QMenuBar @@ -1809,14 +1815,16 @@ QWidget *QMenuBar::cornerWidget(Qt::Corner corner) const \brief Whether or not a menubar will be used as a native menubar on platforms that support it \since 4.6 - This property specifies whether or not the menubar should be used as a native menubar on \macos. + This property specifies whether or not the menubar should be used as a native menubar on + platforms that support it. The currently supported platforms are \macos, and + Linux desktops which use the com.canonical.dbusmenu D-Bus interface (such as Ubuntu Unity). If this property is \c true, the menubar is used in the native menubar and is not in the window of - its parent, if \c false the menubar remains in the window. On other platforms the value of this - attribute has no effect. + its parent; if \c false the menubar remains in the window. On other platforms, + setting this attribute has no effect, and reading this attribute will always return \c false. The default is to follow whether the Qt::AA_DontUseNativeMenuBar attribute - is set for the application. Explicitly settings this property overrides - the presence (or abscence) of the attribute. + is set for the application. Explicitly setting this property overrides + the presence (or absence) of the attribute. */ void QMenuBar::setNativeMenuBar(bool nativeMenuBar) |