diff options
Diffstat (limited to 'src/gui/widgets/qpushbutton.cpp')
-rw-r--r-- | src/gui/widgets/qpushbutton.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp index 7da5930..a1c0d74 100644 --- a/src/gui/widgets/qpushbutton.cpp +++ b/src/gui/widgets/qpushbutton.cpp @@ -387,8 +387,9 @@ bool QPushButton::isDefault() const QSize QPushButton::sizeHint() const { Q_D(const QPushButton); - if (d->sizeHint.isValid()) + if (d->sizeHint.isValid() && d->lastAutoDefault == autoDefault()) return d->sizeHint; + d->lastAutoDefault = autoDefault(); ensurePolished(); int w = 0, h = 0; @@ -657,6 +658,8 @@ bool QPushButton::event(QEvent *e) ) { d->resetLayoutItemMargins(); updateGeometry(); + } else if (e->type() == QEvent::PolishRequest) { + updateGeometry(); } return QAbstractButton::event(e); } |