diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-26 08:29:27 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-26 08:29:27 (GMT) |
commit | e9e2baccfcfc48926414b0f18885140312470cae (patch) | |
tree | 289fd7825c7d4efc67fabfbee1a4b6d363c544b8 /src/gui/widgets | |
parent | 7484a16ffeaf2c7640fc35b424a66cdd8695841c (diff) | |
parent | 7278c142089d46946d1ad2558eae949220dfe0c4 (diff) | |
download | Qt-e9e2baccfcfc48926414b0f18885140312470cae.zip Qt-e9e2baccfcfc48926414b0f18885140312470cae.tar.gz Qt-e9e2baccfcfc48926414b0f18885140312470cae.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index fc55a2c..15eeb09 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -235,16 +235,15 @@ void QMenuPrivate::calcActionRects(QMap<QAction*, QRect> &actionRects, QList<QAc for(int i = 0; i < items.count(); i++) { QAction *action = items.at(i); - QFontMetrics fm(action->font().resolve(q->font())); - QSize sz; - //let the style modify the above size.. QStyleOptionMenuItem opt; q->initStyleOption(&opt, action); opt.rect = q->rect(); + const QFontMetrics &fm = opt.fontMetrics; + QSize sz; if (QWidget *w = widgetItems.value(action)) { - sz=w->sizeHint().expandedTo(w->minimumSize()).expandedTo(w->minimumSizeHint()).boundedTo(w->maximumSize()); + sz = w->sizeHint().expandedTo(w->minimumSize()).expandedTo(w->minimumSizeHint()).boundedTo(w->maximumSize()); } else { //calc what I think the size is.. if (action->isSeparator()) { @@ -1178,7 +1177,8 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) else option->palette.setCurrentColorGroup(QPalette::Disabled); - option->font = action->font(); + option->font = action->font().resolve(font()); + option->fontMetrics = QFontMetrics(option->font); if (d->currentAction && d->currentAction == action && !d->currentAction->isSeparator()) { option->state |= QStyle::State_Selected |