Remove QWindowsComBase

QWindowsComBase is now replaced with QComObject, let's remove the
former since it's a duplication.

Change-Id: I7f911fa036c1f2eaaee168250b8294170430cc5d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
bb10
Pavel Dubsky 2024-03-20 14:58:52 +01:00
parent 2dc78efbe4
commit 72a86dc0f8
1 changed files with 0 additions and 30 deletions

View File

@ -43,36 +43,6 @@ bool qWindowsComQueryUnknownInterfaceMulti(Derived *d, REFIID id, LPVOID *iface)
return false;
}
// Helper base class to provide IUnknown methods for COM classes (single inheritance)
template <class ComInterface> class QWindowsComBase : public ComInterface
{
Q_DISABLE_COPY_MOVE(QWindowsComBase)
public:
explicit QWindowsComBase(ULONG initialRefCount = 1) : m_ref(initialRefCount) {}
virtual ~QWindowsComBase() = default;
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface) override
{
*iface = nullptr;
return qWindowsComQueryInterface<IUnknown>(this, id, iface) || qWindowsComQueryInterface<ComInterface>(this, id, iface)
? S_OK : E_NOINTERFACE;
}
ULONG STDMETHODCALLTYPE AddRef() override { return ++m_ref; }
ULONG STDMETHODCALLTYPE Release() override
{
if (!--m_ref) {
delete this;
return 0;
}
return m_ref;
}
private:
ULONG m_ref;
};
// Clang does not consider __declspec(nothrow) as nothrow
QT_WARNING_DISABLE_CLANG("-Wmicrosoft-exception-spec")
QT_WARNING_DISABLE_CLANG("-Wmissing-exception-spec")