diff --git i/qt-everywhere-commercial-src-4.7.2/src/gui/widgets/qabstractbutton.cpp w/qt-everywhere-commercial-src-4.7.2/src/gui/widgets/qabstractbutton.cpp index 216c108..91e09d3 100644 --- i/qt-everywhere-commercial-src-4.7.2/src/gui/widgets/qabstractbutton.cpp +++ w/qt-everywhere-commercial-src-4.7.2/src/gui/widgets/qabstractbutton.cpp @@ -1122,6 +1122,9 @@ void QAbstractButton::mouseReleaseEvent(QMouseEvent *e) e->accept(); } else { setDown(false); + repaint(); //flush paint event before invoking potentially expensive operation + QApplication::flush(); + d->emitReleased(); e->ignore(); } } @@ -1274,8 +1277,14 @@ void QAbstractButton::focusInEvent(QFocusEvent *e) void QAbstractButton::focusOutEvent(QFocusEvent *e) { Q_D(QAbstractButton); - if (e->reason() != Qt::PopupFocusReason) - d->down = false; + if (e->reason() != Qt::PopupFocusReason) { + if (d->down) { + setDown(false); + repaint(); //flush paint event before invoking potentially expensive operation + QApplication::flush(); + d->emitReleased(); + } + } QWidget::focusOutEvent(e); } @@ -1285,8 +1294,14 @@ void QAbstractButton::changeEvent(QEvent *e) Q_D(QAbstractButton); switch (e->type()) { case QEvent::EnabledChange: - if (!isEnabled()) - setDown(false); + if (!isEnabled()) { + if (d->down) { + setDown(false); + repaint(); //flush paint event before invoking potentially expensive operation + QApplication::flush(); + d->emitReleased(); + } + } break; default: d->sizeHint = QSize();