diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:42:53 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:48:01 +0100 |
commit | c9acfe0bc8dbaec1065614fa2039ebe7e05b4bda (patch) | |
tree | 6ced392965bf01be840da14e7f1606b0b5b2293d /src/activeqt/control | |
parent | f263d206341472e23e0e1ad536faa1b0a22286c0 (diff) | |
parent | cacf666f95df9790cebf5d5cdb0609cee257fab3 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta4
Conflicts:
.qmake.conf
Change-Id: Ie457478a64a28434afb3361dfc6f9478dd9c58bd
Diffstat (limited to 'src/activeqt/control')
-rw-r--r-- | src/activeqt/control/qaxaggregated.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxaggregated.h | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxbindable.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxbindable.h | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxfactory.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxfactory.h | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxmain.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxserver.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 59 | ||||
-rw-r--r-- | src/activeqt/control/qaxserverdll.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxservermain.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qclassfactory_p.h | 12 |
12 files changed, 172 insertions, 19 deletions
diff --git a/src/activeqt/control/qaxaggregated.cpp b/src/activeqt/control/qaxaggregated.cpp index 6ce27a5..61e858b 100644 --- a/src/activeqt/control/qaxaggregated.cpp +++ b/src/activeqt/control/qaxaggregated.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxaggregated.h b/src/activeqt/control/qaxaggregated.h index 80e0212..2192266 100644 --- a/src/activeqt/control/qaxaggregated.h +++ b/src/activeqt/control/qaxaggregated.h @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxbindable.cpp b/src/activeqt/control/qaxbindable.cpp index eaead36..6857c40 100644 --- a/src/activeqt/control/qaxbindable.cpp +++ b/src/activeqt/control/qaxbindable.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxbindable.h b/src/activeqt/control/qaxbindable.h index 69381e6..d2dcc36 100644 --- a/src/activeqt/control/qaxbindable.h +++ b/src/activeqt/control/qaxbindable.h @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxfactory.cpp b/src/activeqt/control/qaxfactory.cpp index 5797bb7..1f101fe 100644 --- a/src/activeqt/control/qaxfactory.cpp +++ b/src/activeqt/control/qaxfactory.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxfactory.h b/src/activeqt/control/qaxfactory.h index 2f7bed1..770aa02 100644 --- a/src/activeqt/control/qaxfactory.h +++ b/src/activeqt/control/qaxfactory.h @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxmain.cpp b/src/activeqt/control/qaxmain.cpp index c030d81..f563e40 100644 --- a/src/activeqt/control/qaxmain.cpp +++ b/src/activeqt/control/qaxmain.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp index 45f6940..ee55f09 100644 --- a/src/activeqt/control/qaxserver.cpp +++ b/src/activeqt/control/qaxserver.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index 779f015..bfc4fc0 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -56,6 +66,7 @@ #include <qmenu.h> #include <qmetaobject.h> #include <qpixmap.h> +#include <qregexp.h> #include <qstatusbar.h> #include <qwhatsthis.h> #include <ocidl.h> @@ -418,7 +429,8 @@ private: IAdviseSink *m_spAdviseSink; QList<STATDATA> adviseSinks; IOleClientSite *m_spClientSite; - IOleInPlaceSiteWindowless *m_spInPlaceSite; + IOleInPlaceSite *m_spInPlaceSite; + IOleInPlaceSiteWindowless *m_spInPlaceSiteWindowless; IOleInPlaceFrame *m_spInPlaceFrame; ITypeInfo *m_spTypeInfo; IStorage *m_spStorage; @@ -1092,6 +1104,7 @@ void QAxServerBase::init() m_spAdviseSink = 0; m_spClientSite = 0; + m_spInPlaceSiteWindowless = 0; m_spInPlaceSite = 0; m_spInPlaceFrame = 0; m_spTypeInfo = 0; @@ -1147,6 +1160,9 @@ QAxServerBase::~QAxServerBase() m_spClientSite = 0; if (m_spInPlaceFrame) m_spInPlaceFrame->Release(); m_spInPlaceFrame = 0; + if (m_spInPlaceSiteWindowless) + m_spInPlaceSiteWindowless->Release(); + m_spInPlaceSiteWindowless = 0; if (m_spInPlaceSite) m_spInPlaceSite->Release(); m_spInPlaceSite = 0; if (m_spTypeInfo) m_spTypeInfo->Release(); @@ -1428,8 +1444,14 @@ LRESULT QT_WIN_CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM && !that->qt.widget->isVisible()) { HWND h = static_cast<HWND>(QGuiApplication::platformNativeInterface()-> nativeResourceForWindow("handle", widgetWindow)); - if (h) + if (h) { ::SetParent(h, that->m_hWnd); + // Since the window is already created, we need to set the + // property directly to ensure it does not believe it is + // toplevel. + widgetWindow->setProperty("_q_embedded_native_parent_handle", + WId(that->m_hWnd)); + } Qt::WindowFlags flags = widgetWindow->flags(); widgetWindow->setFlags(flags | Qt::FramelessWindowHint); } @@ -1604,14 +1626,24 @@ HWND QAxServerBase::create(HWND hWndParent, RECT& rcPos) atom = RegisterClass(&wcTemp); } LeaveCriticalSection(&createWindowSection); - if (!atom && GetLastError() != ERROR_CLASS_ALREADY_EXISTS) - return 0; + if (!atom) { + const DWORD errorCode = GetLastError(); + if (errorCode != ERROR_CLASS_ALREADY_EXISTS) { + qErrnoWarning(int(errorCode), "%s: RegisterClass() failed", __FUNCTION__); + return nullptr; + } + } Q_ASSERT(!m_hWnd); HWND hWnd = ::CreateWindow(reinterpret_cast<const wchar_t *>(cn.utf16()), 0, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, rcPos.left, rcPos.top, rcPos.right - rcPos.left, rcPos.bottom - rcPos.top, hWndParent, 0, hInst, this); + // m_hWnd is assigned in reponse to WM_CREATE + if (!hWnd) { + qErrnoWarning("%s: CreateWindow() failed", __FUNCTION__); + return nullptr; + } Q_ASSERT(m_hWnd == hWnd); @@ -1795,8 +1827,8 @@ void QAxServerBase::update() if (isInPlaceActive) { if (m_hWnd) ::InvalidateRect(m_hWnd, 0, true); - else if (m_spInPlaceSite) - m_spInPlaceSite->InvalidateRect(NULL, true); + else if (m_spInPlaceSiteWindowless) + m_spInPlaceSiteWindowless->InvalidateRect(NULL, true); } else if (m_spAdviseSink) { m_spAdviseSink->OnViewChange(DVASPECT_CONTENT, -1); for (int i = 0; i < adviseSinks.count(); ++i) { @@ -3732,6 +3764,9 @@ HRESULT WINAPI QAxServerBase::Close(DWORD dwSaveOption) m_spClientSite->OnShowWindow(false); } + if (m_spInPlaceSiteWindowless) + m_spInPlaceSiteWindowless->Release(); + m_spInPlaceSiteWindowless = 0; if (m_spInPlaceSite) m_spInPlaceSite->Release(); m_spInPlaceSite = 0; @@ -3787,7 +3822,10 @@ HRESULT QAxServerBase::internalActivate() if (!::IsChild(m_hWnd, ::GetFocus()) && qt.widget->focusPolicy() != Qt::NoFocus) ::SetFocus(m_hWnd); } else { - create(hwndParent, rcPos); + if (!create(hwndParent, rcPos)) { + qWarning("%s: Window creation failed.", __FUNCTION__); + return E_FAIL; + } } } @@ -3989,6 +4027,9 @@ HRESULT WINAPI QAxServerBase::SetClientSite(IOleClientSite* pClientSite) { // release all client site interfaces if (m_spClientSite) m_spClientSite->Release(); + if (m_spInPlaceSiteWindowless) + m_spInPlaceSiteWindowless->Release(); + m_spInPlaceSiteWindowless = 0; if (m_spInPlaceSite) m_spInPlaceSite->Release(); m_spInPlaceSite = 0; if (m_spInPlaceFrame) m_spInPlaceFrame->Release(); @@ -3998,6 +4039,8 @@ HRESULT WINAPI QAxServerBase::SetClientSite(IOleClientSite* pClientSite) if (m_spClientSite) { m_spClientSite->AddRef(); m_spClientSite->QueryInterface(IID_IOleInPlaceSite, reinterpret_cast<void **>(&m_spInPlaceSite)); + m_spClientSite->QueryInterface(IID_IOleInPlaceSiteWindowless, + reinterpret_cast<void **>(&m_spInPlaceSiteWindowless)); } return S_OK; diff --git a/src/activeqt/control/qaxserverdll.cpp b/src/activeqt/control/qaxserverdll.cpp index b0584d5..06fe6b9 100644 --- a/src/activeqt/control/qaxserverdll.cpp +++ b/src/activeqt/control/qaxserverdll.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qaxservermain.cpp b/src/activeqt/control/qaxservermain.cpp index e6ddd52..7e7bb3e 100644 --- a/src/activeqt/control/qaxservermain.cpp +++ b/src/activeqt/control/qaxservermain.cpp @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/activeqt/control/qclassfactory_p.h b/src/activeqt/control/qclassfactory_p.h index 633c6f1..4a5944a 100644 --- a/src/activeqt/control/qclassfactory_p.h +++ b/src/activeqt/control/qclassfactory_p.h @@ -6,7 +6,17 @@ ** This file is part of the ActiveQt framework of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are |