static QRect spinBoxEditFieldRect(const QWidget* w, const QStyleOptionSpinBox& option) { QRect r = w->style()->subControlRect(QStyle::CC_SpinBox, &option, QStyle::SC_SpinBoxEditField); if (isOxygenStyle(w)) { int xadjust = 3; r.adjust(xadjust, 2, -xadjust, -2); } return r; }
static QRect spinBoxEditFieldRect(const QWidget* w, const QStyleOptionSpinBox& option) { QRect r = w->style()->subControlRect(QStyle::CC_SpinBox, &option, QStyle::SC_SpinBoxEditField); if (isOxygenStyle(w)) { int xadjust = (KDE::version() >= KDE_MAKE_VERSION(4,6,0)) ? 3 : 2; r.adjust(xadjust, 2, -xadjust, -2); } return r; }
void SpinMirror::setButtonPos(const QPoint& pos) { //qCDebug(KALARM_LOG)<<pos; int x = pos.x(); int y = pos.y(); if (isOxygenStyle(this)) { // Oxygen spin buttons don't use all their height. Prevent // the top overlapping the frame highlighting. Their height // is shortened in setButton() above. ++y; } mButtons->setPos(x, y); }
void SpinMirror::setButtons() { mSpinbox->inhibitPaintSignal(2); QStyleOptionSpinBox option; mSpinbox->initStyleOption(option); QStyle* st = mSpinbox->style(); QRect r = st->subControlRect(QStyle::CC_SpinBox, &option, QStyle::SC_SpinBoxUp) | st->subControlRect(QStyle::CC_SpinBox, &option, QStyle::SC_SpinBoxDown); if (isOxygenStyle(mSpinbox)) { // They don't use all their height, so shorten them to // allow frame highlighting to work properly. r.setTop(r.top() + 1); r.setHeight(r.height() - 2); } mSpinbox->inhibitPaintSignal(1); mButtons->setPixmap(grabWidget(mSpinbox, r)); mSpinbox->inhibitPaintSignal(0); }