src/gui/widgets/qpushbutton.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
--- a/src/gui/widgets/qpushbutton.cpp	Fri Sep 17 08:34:18 2010 +0300
+++ b/src/gui/widgets/qpushbutton.cpp	Mon Oct 04 01:19:32 2010 +0300
@@ -687,11 +687,11 @@
 /*! \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);