summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-11-02 10:31:32 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-11-02 10:31:32 (GMT)
commit1d440cf00ded21432ca4be36bf5be60bbddf87d1 (patch)
tree557fb8153c0e21374ca49f6aee932420b8bdf00a /src/gui/styles
parentbe651bb65e952743f4bc31a970750be501bcf978 (diff)
parente1a08048f29174c01e289a4f608aaa283819c5d5 (diff)
downloadQt-1d440cf00ded21432ca4be36bf5be60bbddf87d1.zip
Qt-1d440cf00ded21432ca4be36bf5be60bbddf87d1.tar.gz
Qt-1d440cf00ded21432ca4be36bf5be60bbddf87d1.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt-widget-team into 4.6
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 2d90aa1..2ae9f6a 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -3370,7 +3370,9 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
if (rule.hasPosition() && rule.position()->textAlignment != 0) {
Qt::Alignment textAlignment = rule.position()->textAlignment;
QRect textRect = button->rect;
- uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic;
+ uint tf = Qt::TextShowMnemonic;
+ const uint verticalAlignMask = Qt::AlignVCenter | Qt::AlignTop | Qt::AlignLeft;
+ tf |= (textAlignment & verticalAlignMask) ? (textAlignment & verticalAlignMask) : Qt::AlignVCenter;
if (!styleHint(SH_UnderlineShortcut, button, w))
tf |= Qt::TextHideMnemonic;
if (!button->icon.isNull()) {