diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-06-29 07:00:09 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-06-29 07:00:09 (GMT) |
commit | 74b3de38bce01b06954e7ff836693f80dc9e66ee (patch) | |
tree | 62d1e8c3e921327bed678859636a92f56285dbba /src | |
parent | 81efb149c9cea095ef62ceb11a963a0fb0fad73e (diff) | |
parent | a8cd5dc1294f2bbaa12c88d7f59b61a1011f5d18 (diff) | |
download | Qt-74b3de38bce01b06954e7ff836693f80dc9e66ee.zip Qt-74b3de38bce01b06954e7ff836693f80dc9e66ee.tar.gz Qt-74b3de38bce01b06954e7ff836693f80dc9e66ee.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qpushbutton.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/qpushbutton_p.h | 3 |
2 files changed, 6 insertions, 2 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); } diff --git a/src/gui/widgets/qpushbutton_p.h b/src/gui/widgets/qpushbutton_p.h index 0c5ac79..9d682d8 100644 --- a/src/gui/widgets/qpushbutton_p.h +++ b/src/gui/widgets/qpushbutton_p.h @@ -65,7 +65,7 @@ public: QPushButtonPrivate() : QAbstractButtonPrivate(QSizePolicy::PushButton), autoDefault(Auto), - defaultButton(false), flat(false), menuOpen(false) {} + defaultButton(false), flat(false), menuOpen(false), lastAutoDefault(false) {} inline void init() { resetLayoutItemMargins(); } void resetLayoutItemMargins(); @@ -77,6 +77,7 @@ public: uint defaultButton : 1; uint flat : 1; uint menuOpen : 1; + mutable uint lastAutoDefault : 1; }; QT_END_NAMESPACE |