diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-11 10:27:56 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-25 10:06:43 +0000 |
commit | 4f599c5ea180f5246adf2a95c158b50f027a8c21 (patch) | |
tree | 9755d632ef6d556dcb34399019a9c77cf0b89eea /src/plugins/platforms/windows/qwindowscombase.h | |
parent | a06148e3414744cc4153f40a5610bad53ffebd62 (diff) |
Enable IAccessible2 for MinGW
MinGW 5.3 is able to compile the IAccessible2 classes. All that is needed
is some way to provide the missing IIDs, which is done via specialization
of a function template (similar to the MinGW's __uuidof operator).
[ChangeLog][Windows][Accessibility] MinGW builds now support IAccessible2.
Change-Id: I218a4b89c81b54aa96f7c743544388631ca9a53e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscombase.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscombase.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowscombase.h b/src/plugins/platforms/windows/qwindowscombase.h index f8afcc81cf..5e51b6b7b7 100644 --- a/src/plugins/platforms/windows/qwindowscombase.h +++ b/src/plugins/platforms/windows/qwindowscombase.h @@ -46,11 +46,17 @@ QT_BEGIN_NAMESPACE +// The __uuidof operator of MinGW does not work for all interfaces (for example, +// IAccessible2). Specializations of this function can be provides to work +// around this. +template <class DesiredInterface> +static IID qUuidOf() { return __uuidof(DesiredInterface); } + // Helper for implementing IUnknown::QueryInterface. template <class DesiredInterface, class Derived> bool qWindowsComQueryInterface(Derived *d, REFIID id, LPVOID *iface) { - if (id == __uuidof(DesiredInterface)) { + if (id == qUuidOf<DesiredInterface>()) { *iface = static_cast<DesiredInterface *>(d); d->AddRef(); return true; |