diff options
Diffstat (limited to 'src/widgets/kernel/qaction.cpp')
-rw-r--r-- | src/widgets/kernel/qaction.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 4dd10720d6..2c4e4d3125 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -223,8 +223,9 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) \snippet mainwindows/application/mainwindow.cpp 19 \codeline - \snippet mainwindows/application/mainwindow.cpp 28 - \snippet mainwindows/application/mainwindow.cpp 31 + \code + fileMenu->addAction(openAct); + \endcode We recommend that actions are created as children of the window they are used in. In most cases actions will be children of @@ -254,7 +255,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) \value TextHeuristicRole This action should be put in the application menu based on the action's text as described in the QMenuBar documentation. \value ApplicationSpecificRole This action should be put in the application menu with an application specific role - \value AboutQtRole This action matches handles the "About Qt" menu item. + \value AboutQtRole This action handles the "About Qt" menu item. \value AboutRole This action should be placed where the "About" menu item is in the application menu. The text of the menu item will be set to "About <application name>". The application name is fetched from the \c{Info.plist} file in the application's bundle (See \l{Qt for OS X - Deployment}). @@ -1230,7 +1231,7 @@ void QAction::activate(ActionEvent event) \since 4.2 This indicates what role the action serves in the application menu on Mac - OS X. By default all action have the TextHeuristicRole, which means that + OS X. By default all actions have the TextHeuristicRole, which means that the action is added based on its text (see QMenuBar for more information). The menu role can only be changed before the actions are put into the menu @@ -1269,7 +1270,7 @@ QAction::MenuRole QAction::menuRole() const For example: \snippet code/src_gui_kernel_qaction.cpp 0 - \sa QAction::icon, QApplication::setAttribute() + \sa QAction::icon, QCoreApplication::setAttribute() */ void QAction::setIconVisibleInMenu(bool visible) { |