diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-08-03 12:22:40 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-08-04 07:38:36 (GMT) |
commit | b0965cd049997283976c132fceb9727b6582ca49 (patch) | |
tree | b2524df6e9bb6cd0d1b5e58d3c026f9417cced3b /src/gui/widgets | |
parent | 0b736b21b5acd2cd412f70b7aa5902e0aa091dfc (diff) | |
download | Qt-b0965cd049997283976c132fceb9727b6582ca49.zip Qt-b0965cd049997283976c132fceb9727b6582ca49.tar.gz Qt-b0965cd049997283976c132fceb9727b6582ca49.tar.bz2 |
Mac: fix regression from 65a673f that makes some buttons unclickable
If a button has a small gemoetry, the mac style will reender it as
flat. Change 65a673f did not take this logic into account when
massaging the hit rect of the button. This patch will.
Task-number: QTBUG-10401
Reviewed-by: cduclos
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qpushbutton.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp index 8a18ed0..237c266 100644 --- a/src/gui/widgets/qpushbutton.cpp +++ b/src/gui/widgets/qpushbutton.cpp @@ -687,11 +687,11 @@ bool QPushButton::event(QEvent *e) /*! \reimp */ bool QPushButton::hitButton(const QPoint &pos) const { - // This is only required if we are using the native style, so check that first. - QMacStyle *macStyle = qobject_cast<QMacStyle *>(style()); - // If this is a flat button we just bail out. - if(isFlat() || (0 == macStyle)) + QStyleOptionButton opt; + initStyleOption(&opt); + if (qt_mac_buttonIsRenderedFlat(this, &opt)) return QAbstractButton::hitButton(pos); + // Now that we know we are using the native style, let's proceed. Q_D(const QPushButton); QPushButtonPrivate *nonConst = const_cast<QPushButtonPrivate *>(d); |