diff options
author | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-08-10 13:12:08 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-08-12 11:05:55 (GMT) |
commit | 693b34e8c8d434fd4cde6bfd5f4944e6f9283532 (patch) | |
tree | ab22f50dc11fa20515b20fc6ac8608a1b2fb243c /src/gui | |
parent | 70ad574793adf908f3aae96a58cda229dceb8cf8 (diff) | |
download | Qt-693b34e8c8d434fd4cde6bfd5f4944e6f9283532.zip Qt-693b34e8c8d434fd4cde6bfd5f4944e6f9283532.tar.gz Qt-693b34e8c8d434fd4cde6bfd5f4944e6f9283532.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/gui')
-rw-r--r-- | src/gui/styles/qwindowscestyle.cpp | 6 | ||||
-rw-r--r-- | src/gui/styles/qwindowsmobilestyle.cpp | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/styles/qwindowscestyle.cpp b/src/gui/styles/qwindowscestyle.cpp index 40ccaa6..4817da0 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 efc2892..85d828b 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; |