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>
This commit is contained in:
parent
1f925d47e9
commit
43d935aa2d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user