4#ifndef QWINDOWSCOMBASE_H
5#define QWINDOWSCOMBASE_H
9#include <QtCore/qglobal.h>
18template <
class DesiredInterface>
19static IID qUuidOf() {
return __uuidof(DesiredInterface); }
22template <
class DesiredInterface,
class Derived>
25 if (
id == qUuidOf<DesiredInterface>()) {
26 *iface =
static_cast<DesiredInterface *
>(
d);
35template <
class FirstInheritedInterface,
class Derived>
38 if (
id == __uuidof(IUnknown)) {
39 *iface =
static_cast<FirstInheritedInterface *
>(
d);
57 return qWindowsComQueryInterface<IUnknown>(
this,
id, iface) || qWindowsComQueryInterface<ComInterface>(
this,
id, iface)
58 ? S_OK : E_NOINTERFACE;
61 ULONG STDMETHODCALLTYPE
AddRef()
override {
return ++m_ref; }
63 ULONG STDMETHODCALLTYPE
Release()
override
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface) override
ULONG STDMETHODCALLTYPE Release() override
ULONG STDMETHODCALLTYPE AddRef() override
virtual ~QWindowsComBase()=default
QWindowsComBase(ULONG initialRefCount=1)
Combined button and popup list for selecting options.
#define QT_WARNING_DISABLE_CLANG(text)
bool qWindowsComQueryUnknownInterfaceMulti(Derived *d, REFIID id, LPVOID *iface)
bool qWindowsComQueryInterface(Derived *d, REFIID id, LPVOID *iface)
static QT_BEGIN_NAMESPACE IID qUuidOf()