From c7ac077128a06e9c1f2befb6be98b779be73d216 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 4 Dec 2014 15:27:03 +0300 Subject: [PATCH] Doc: Fix description of QStyleOptionMenuItem::tabWidth It is actually not the tab width but the width reserved for the menu item's shortcut. Change-Id: I801dff0c57256690f61c022156a80cf6ff530c43 Reviewed-by: Martin Smith --- src/widgets/styles/qstyleoption.cpp | 8 +++++--- src/widgets/styles/qstyleoption.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 3666bce2050..774c039ecc7 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -1842,10 +1842,12 @@ QStyleOptionMenuItem::QStyleOptionMenuItem(int version) /*! \variable QStyleOptionMenuItem::tabWidth - \brief the tab width for the menu item + \brief the reserved width for the menu item's shortcut - The tab width is the distance between the text of the menu item - and the shortcut. The default value is 0. + QMenu sets it to the width occupied by the widest shortcut among + all visible items within the menu. + + The default value is 0. */ diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index 28809175100..241399543bd 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -366,7 +366,7 @@ public: QString text; QIcon icon; int maxIconWidth; - int tabWidth; + int tabWidth; // ### Qt 6: rename to reservedShortcutWidth QFont font; QStyleOptionMenuItem();