summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-01-13 16:36:31 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-01-13 15:43:53 +0000
commit9893cff4d834c9bef1ecf9b853d261ed144e16dc (patch)
tree0f43b6090683508145944f70a7f7df564eab1668
parent8a87fad08354a1ff0fddef28296e5c3e1803a998 (diff)
Prevent creation of multiple QAxClientSite/QAxHostWidget objects.
Multiple instances of QAxClientSite and host windows were created from QAxBase::metaObject() via QAxWidget::initialize(). In testcon, this for example happens in a qobject_cast<> in the event filter installed on QApplication by its QMDIArea before the CLSID is set. Change-Id: I517c971b7d1ebfba894cfde70c8ef961795ca961 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r--src/activeqt/container/qaxwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index a099bad..987c649 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -1965,8 +1965,9 @@ bool QAxWidget::createHostWindow(bool initialized)
*/
bool QAxWidget::createHostWindow(bool initialized, const QByteArray &data)
{
+ if (!container) // Potentially called repeatedly from QAxBase::metaObject(), QAxWidget::initialize()
+ container = new QAxClientSite(this);
- container = new QAxClientSite(this);
container->activateObject(initialized, data);
ATOM filter_ref = FindAtom(qaxatom);