From 50624a969d130ec55a6fd8e908b5b5e4e17636fb Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sat, 18 Jul 2009 13:21:25 +0200 Subject: Doc: Document QAction::Priority and Qt::ToolButtonFollowStyle. --- doc/src/qnamespace.qdoc | 1 + src/gui/kernel/qaction.cpp | 29 +++++++++++++++++++++++++---- src/gui/widgets/qtoolbutton.cpp | 5 ++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index ded1577..2d40fdd 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -1697,6 +1697,7 @@ \value ToolButtonTextOnly Only display the text. \value ToolButtonTextBesideIcon The text appears beside the icon. \value ToolButtonTextUnderIcon The text appears under the icon. + \value ToolButtonFollowStyle Follow the \l{QStyle::SH_ToolButtonStyle}{style}. */ /*! diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 09ba6cc..5952320 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -910,14 +910,35 @@ QString QAction::whatsThis() const } /*! + \enum QAction::Priority + \since 4.6 + + This enum defines priorities for actions in user interface. + + \value LowPriority The action will not be prioritized in + collapsible layouts when not enough space for all actions is + available. + + \value NormalPriority + + \value HighPriority The action will be prioritized by + collapsible layouts when not enough space for all actions is + available. + + \sa priority +*/ + + +/*! \property QAction::priority \since 4.6 - \brief tells collapsible layouts how the action should be prioritized + \brief the actions's priority in the user interface. - This property can be set to indicate that an action should be prioritied - in a layout. For instance when toolbars have the Qt::ToolButtonTextBesideIcon - mode is set, lower priority actions will hide text labels to preserve space. + This property can be set to indicate how the action should be prioritized + in a collapsible layout. For instance, when toolbars have the Qt::ToolButtonTextBesideIcon + mode set, then lower priority actions will hide text labels to preserve + horizontal space if necessary. */ void QAction::setPriority(Priority priority) { diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp index 3901245..2c85dc5 100644 --- a/src/gui/widgets/qtoolbutton.cpp +++ b/src/gui/widgets/qtoolbutton.cpp @@ -486,9 +486,8 @@ QSize QToolButton::minimumSizeHint() const The default is Qt::ToolButtonIconOnly. - If you want your toolbars to depend on system settings, - as is possible in GNOME and KDE desktop environments you should - use the ToolButtonFollowStyle. + To have the style of toolbuttons follow the system settings (as available + in GNOME and KDE desktop environments), set this property to Qt::ToolButtonFollowStyle. QToolButton automatically connects this slot to the relevant signal in the QMainWindow in which is resides. -- cgit v0.12