summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyle.cpp
diff options
context:
space:
mode:
authorKevin Ottens <ervin@kde.org>2013-02-27 17:11:41 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-13 15:00:52 +0100
commit03e2ea2ac057b2b4aa1dc4e5b817ffd552080ce5 (patch)
treecf306fa7a16caaaff9f0b04234ee6667fe723f11 /src/widgets/styles/qstyle.cpp
parentbad1918cb438874e31dee05536e300c3470c7b23 (diff)
Add convenience for section actions in QMenu
Those actions are just separators having also text and potentially icon. It is very convenient to create titled sections in a menu, or give a title to a context menu. Obviously requires support for them on the style side, but modern styles like fusion or oxygen handle them just fine. For legacy styles it properly falls back to a regular separator aspect. That's why a specific style hint is also introduced. It is used by QMenu to know how the sections will be treated and take care of them correctly when eliminating duplicated separators or separators at the beginning of the menu. Change-Id: Iad00a93422b7983dc90dfc4b4b1c360122e47610 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/widgets/styles/qstyle.cpp')
-rw-r--r--src/widgets/styles/qstyle.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 9c4901795d..1d4e4bd570 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -1891,6 +1891,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SH_ScrollBar_Transient Determines if the style supports transient scroll bars. Transient
scroll bars appear when the content is scrolled and disappear when they are no longer needed.
+ \value SH_Menu_SupportsSections Determines if the style displays sections in menus or treat them as
+ plain separators. Sections are separators with a text and icon hint.
+
\sa styleHint()
*/