summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenubar.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-14 10:06:26 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-14 10:07:56 (GMT)
commitaf2b01c4571b468a57cb4e5e72dab481f6d88eb1 (patch)
tree131655d6f0c2d8450a82f5cf412e5211c312f067 /src/gui/widgets/qmenubar.cpp
parent0eb365bca2dc3b7244b3c9adec65a17cd36123be (diff)
downloadQt-af2b01c4571b468a57cb4e5e72dab481f6d88eb1.zip
Qt-af2b01c4571b468a57cb4e5e72dab481f6d88eb1.tar.gz
Qt-af2b01c4571b468a57cb4e5e72dab481f6d88eb1.tar.bz2
Use the correct font metrics function.
Qt::TextShowMnemonic removes the '&' for us. This is required if we want the multi-lenght-variant strings working. Reviewed-by: Thierry
Diffstat (limited to 'src/gui/widgets/qmenubar.cpp')
-rw-r--r--src/gui/widgets/qmenubar.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index be6ed67..6b93879 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -447,10 +447,7 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start) const
} else {
const QString s = action->text();
if(!s.isEmpty()) {
- const int w = fm.width(s)
- - s.count(QLatin1Char('&')) * fm.width(QLatin1Char('&'))
- + s.count(QLatin1String("&&")) * fm.width(QLatin1Char('&'));
- sz = QSize(w, fm.height());
+ sz = fm.size(Qt::TextShowMnemonic, s);
}
QIcon is = action->icon();