From b4008713a2a6229de6d15b1f4050167bf6664e64 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 10 Jul 2013 14:13:39 +0200 Subject: Windows/ActiveQt: Pass native parent handle property from widget to widget window. Task-number: QTBUG-31672 Task-number: QTBUG-32343 Change-Id: I6b1eca13248da06db739b1a8356a0259f7f4ae6c Reviewed-by: Miikka Heikkinen Reviewed-by: Oliver Wolff --- src/widgets/kernel/qwidget_qpa.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index dafe7dc42a..f0846bea6b 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -887,6 +887,10 @@ void QWidgetPrivate::deleteSysExtra() } +#ifdef Q_OS_WIN +static const char activeXNativeParentHandleProperty[] = "_q_embedded_native_parent_handle"; +#endif + void QWidgetPrivate::createTLSysExtra() { Q_Q(QWidget); @@ -897,6 +901,10 @@ void QWidgetPrivate::createTLSysExtra() if (extra->maxw != QWIDGETSIZE_MAX || extra->maxh != QWIDGETSIZE_MAX) extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh)); #ifdef Q_OS_WIN + // Pass on native parent handle for Widget embedded into Active X. + const QVariant activeXNativeParentHandle = q->property(activeXNativeParentHandleProperty); + if (activeXNativeParentHandle.isValid()) + extra->topextra->window->setProperty(activeXNativeParentHandleProperty, activeXNativeParentHandle); if (q->inherits("QTipLabel") || q->inherits("QAlphaWidget")) extra->topextra->window->setProperty("_q_windowsDropShadow", QVariant(true)); #endif -- cgit v1.2.3