diff options
Diffstat (limited to 'src/widgets/widgets/qpushbutton.cpp')
-rw-r--r-- | src/widgets/widgets/qpushbutton.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index f48b5706f7..3d075bf92f 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -297,7 +297,7 @@ QDialog *QPushButtonPrivate::dialogParent() const if (const QDialog *dialog = qobject_cast<const QDialog *>(p)) return const_cast<QDialog *>(dialog); } - return 0; + return nullptr; } #endif @@ -353,7 +353,7 @@ bool QPushButton::autoDefault() const { Q_D(const QPushButton); if(d->autoDefault == QPushButtonPrivate::Auto) - return ( d->dialogParent() != 0 ); + return ( d->dialogParent() != nullptr ); return d->autoDefault; } @@ -496,7 +496,7 @@ void QPushButton::focusOutEvent(QFocusEvent *e) #if QT_CONFIG(dialog) QDialog *dlg = qobject_cast<QDialog*>(window()); if (dlg) - dlg->d_func()->setDefault(0); + dlg->d_func()->setDefault(nullptr); else d->defaultButton = false; #endif @@ -509,6 +509,17 @@ void QPushButton::focusOutEvent(QFocusEvent *e) #endif } +/*! + \reimp +*/ +bool QPushButton::hitButton(const QPoint &pos) const +{ + QStyleOptionButton option; + initStyleOption(&option); + const QRect bevel = style()->subElementRect(QStyle::SE_PushButtonBevel, &option, this); + return bevel.contains(pos); +} + #if QT_CONFIG(menu) /*! Associates the popup menu \a menu with this push button. This |