summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-10 13:12:08 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-10 15:11:35 (GMT)
commita6d51bc97a923bd990e5188035f7c913456138f7 (patch)
tree005f207c53ebc28b515d7052e4329f6affb7f1bc /src
parentc3610da4be9b12bfe01b565db5ed2508da88c120 (diff)
downloadQt-a6d51bc97a923bd990e5188035f7c913456138f7.zip
Qt-a6d51bc97a923bd990e5188035f7c913456138f7.tar.gz
Qt-a6d51bc97a923bd990e5188035f7c913456138f7.tar.bz2
respect QAbstractSpinBox::NoButtons in windowsce / windowsmobile styles
Code is adapted from QCommonStyle which handles this case for other styles. Reviewed-by: thartman
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qwindowscestyle.cpp6
-rw-r--r--src/gui/styles/qwindowsmobilestyle.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/styles/qwindowscestyle.cpp b/src/gui/styles/qwindowscestyle.cpp
index 997fc72..cd13dd8 100644
--- a/src/gui/styles/qwindowscestyle.cpp
+++ b/src/gui/styles/qwindowscestyle.cpp
@@ -1951,7 +1951,11 @@ QRect QWindowsCEStyle::subControlRect(ComplexControl control, const QStyleOption
rect = QRect(x, y , bs.width(), bs.height());
break;
case SC_SpinBoxEditField:
- rect = QRect(lx, fw, rx-2, spinbox->rect.height() - 2*fw);
+ if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) {
+ rect = QRect(lx, fw, spinbox->rect.width() - 2*fw - 2, spinbox->rect.height() - 2*fw);
+ } else {
+ rect = QRect(lx, fw, rx-2, spinbox->rect.height() - 2*fw);
+ }
break;
case SC_SpinBoxFrame:
rect = spinbox->rect;
diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp
index c70b4c8..e708042 100644
--- a/src/gui/styles/qwindowsmobilestyle.cpp
+++ b/src/gui/styles/qwindowsmobilestyle.cpp
@@ -2984,7 +2984,11 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp
rect = QRect(x + bs.width(), 0, bs.width(), bs.height());
break;
case SC_SpinBoxEditField:
+ if (spinBox->buttonSymbols == QAbstractSpinBox::NoButtons) {
+ rect = QRect(lx, fw, spinBox->rect.width() - 2*fw - 2, spinBox->rect.height() - 2*fw);
+ } else {
rect = QRect(lx, fw, rx-2, spinBox->rect.height() - 2*fw);
+ }
break;
case SC_SpinBoxFrame:
rect = spinBox->rect;