338 void Q3SpinWidget::paintEvent(QPaintEvent *) |
338 void Q3SpinWidget::paintEvent(QPaintEvent *) |
339 { |
339 { |
340 QPainter p(this); |
340 QPainter p(this); |
341 QStyleOptionSpinBox opt = getStyleOption(this); |
341 QStyleOptionSpinBox opt = getStyleOption(this); |
342 |
342 |
343 if (d->theButton & 1) |
343 if (d->theButton & 1) { |
344 opt.activeSubControls = QStyle::SC_SpinBoxDown; |
344 opt.activeSubControls = QStyle::SC_SpinBoxDown; |
345 else if (d->theButton & 2) |
345 opt.state |= QStyle::State_Sunken; |
|
346 } else if (d->theButton & 2) { |
346 opt.activeSubControls = QStyle::SC_SpinBoxUp; |
347 opt.activeSubControls = QStyle::SC_SpinBoxUp; |
347 else |
348 opt.state |= QStyle::State_Sunken; |
|
349 } else |
348 opt.activeSubControls = QStyle::SC_None; |
350 opt.activeSubControls = QStyle::SC_None; |
349 opt.rect = style()->subControlRect(QStyle::CC_SpinBox, &opt, QStyle::SC_SpinBoxFrame, this); |
351 opt.rect = style()->subControlRect(QStyle::CC_SpinBox, &opt, QStyle::SC_SpinBoxFrame, this); |
350 opt.subControls = QStyle::SC_All; |
352 opt.subControls = QStyle::SC_All; |
351 style()->drawComplexControl(QStyle::CC_SpinBox, &opt, &p, this); |
353 style()->drawComplexControl(QStyle::CC_SpinBox, &opt, &p, this); |
352 } |
354 } |