From 62db1b73220b77e1e424e76cae35aaddf2a0709d Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Tue, 4 May 2010 10:48:00 +0200 Subject: When one of the spin button subcontrol is activated, the state member of the style option object should have QStyle::State_Sunken set in order for styles to paint the button as pressed. Merge-Request: 607 Reviewed-by: Andreas --- src/qt3support/widgets/q3spinwidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt3support/widgets/q3spinwidget.cpp b/src/qt3support/widgets/q3spinwidget.cpp index 3dc36c5..3bfad06 100644 --- a/src/qt3support/widgets/q3spinwidget.cpp +++ b/src/qt3support/widgets/q3spinwidget.cpp @@ -340,11 +340,13 @@ void Q3SpinWidget::paintEvent(QPaintEvent *) QPainter p(this); QStyleOptionSpinBox opt = getStyleOption(this); - if (d->theButton & 1) + if (d->theButton & 1) { opt.activeSubControls = QStyle::SC_SpinBoxDown; - else if (d->theButton & 2) + opt.state |= QStyle::State_Sunken; + } else if (d->theButton & 2) { opt.activeSubControls = QStyle::SC_SpinBoxUp; - else + opt.state |= QStyle::State_Sunken; + } else opt.activeSubControls = QStyle::SC_None; opt.rect = style()->subControlRect(QStyle::CC_SpinBox, &opt, QStyle::SC_SpinBoxFrame, this); opt.subControls = QStyle::SC_All; -- cgit v0.12