mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
remove redundant check in QPushButton::sizeHint()
QPushButton::setAutoDefault() invalidates the cached size hint Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d87d2a4e09
commit
a8068fc969
2 changed files with 6 additions and 5 deletions
|
@ -359,9 +359,9 @@ bool QPushButton::isDefault() const
|
|||
QSize QPushButton::sizeHint() const
|
||||
{
|
||||
Q_D(const QPushButton);
|
||||
if (d->sizeHint.isValid() && d->lastAutoDefault == autoDefault())
|
||||
if (d->sizeHint.isValid()) {
|
||||
return d->sizeHint;
|
||||
d->lastAutoDefault = autoDefault();
|
||||
}
|
||||
ensurePolished();
|
||||
|
||||
int w = 0, h = 0;
|
||||
|
|
|
@ -48,7 +48,9 @@ public:
|
|||
|
||||
QPushButtonPrivate()
|
||||
: QAbstractButtonPrivate(QSizePolicy::PushButton), autoDefault(Auto),
|
||||
defaultButton(false), flat(false), menuOpen(false), lastAutoDefault(false) {}
|
||||
defaultButton(false), flat(false), menuOpen(false)
|
||||
{
|
||||
}
|
||||
|
||||
inline void init() { resetLayoutItemMargins(); }
|
||||
static QPushButtonPrivate* get(QPushButton *b) { return b->d_func(); }
|
||||
|
@ -64,7 +66,6 @@ public:
|
|||
bool defaultButton;
|
||||
bool flat;
|
||||
bool menuOpen;
|
||||
mutable bool lastAutoDefault;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
Loading…
Add table
Reference in a new issue