summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetwindow.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-02-22 08:19:01 +0100
committerAndy Shaw <andy.shaw@qt.io>2019-04-01 12:22:54 +0000
commita49c5648919a0bd2d8206ae7fb5033c9f84e0a86 (patch)
tree25b7c3d198b7752cbac3e33fdfe4ae8fbb5e046e /src/widgets/kernel/qwidgetwindow.cpp
parente104c1972877c1732aa3c58f52bb766a0bfa29e7 (diff)
Implement support for WA_MacNoClickThrough
This is done by adding a QWindowPrivate::allowsClickThrough() function, so this could easily be adapted later on if desired for other platforms. Fixes: QTBUG-41126 Change-Id: I1157e5e7e7667ff11d1a5d21b3ce8c4b13202272 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow.cpp')
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index c6f22aa21a..f44f63d71b 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -106,6 +106,7 @@ public:
if (QWidget *widget = q->widget())
QWidgetPrivate::get(widget)->updateContentsRect();
}
+ bool allowClickThrough(const QPoint &) const override;
};
QRectF QWidgetWindowPrivate::closestAcceptableGeometry(const QRectF &rect) const
@@ -221,6 +222,12 @@ static inline bool shouldBePropagatedToWidget(QEvent *event)
}
}
+bool QWidgetWindowPrivate::allowClickThrough(const QPoint &globalPos) const
+{
+ QWidget *w = QApplication::widgetAt(globalPos);
+ return w && !w->testAttribute(Qt::WA_MacNoClickThrough);
+}
+
bool QWidgetWindow::event(QEvent *event)
{
if (!m_widget)