From 03e2ea2ac057b2b4aa1dc4e5b817ffd552080ce5 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 27 Feb 2013 17:11:41 +0100 Subject: 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) Reviewed-by: Lars Knoll --- src/widgets/styles/qfusionstyle.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/styles/qfusionstyle.cpp') diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index defdf30b6b..ee237ac71a 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -3473,6 +3473,7 @@ int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QW case SH_ItemView_ChangeHighlightOnFocus: case SH_MenuBar_MouseTracking: case SH_Menu_MouseTracking: + case SH_Menu_SupportsSections: return 1; case SH_ToolBox_SelectedPageTitleBold: -- cgit v1.2.3