From 15c9ffc20f205e32b9297249be944bcbedd84fc7 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@qt.io>
Date: Wed, 10 Jan 2018 17:09:12 +0100
Subject: [PATCH] Fix compilation with newer gcc

Move disabling of overloaded-virtual warning before the includes,
and the Q_OBJECT definition, to make it effective.

Task-number: QTBUG-65676
Change-Id: Ic34e5ade0b21b53540db9b2f429f1b441463632c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
---
 src/activeqt/control/qaxfactory.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/activeqt/control/qaxfactory.h b/src/activeqt/control/qaxfactory.h
index 770aa02f..e2c327b6 100644
--- a/src/activeqt/control/qaxfactory.h
+++ b/src/activeqt/control/qaxfactory.h
@@ -51,6 +51,11 @@
 #ifndef QAXFACTORY_H
 #define QAXFACTORY_H
 
+#include <QtCore/qcompilerdetection.h>
+
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_GCC("-Woverloaded-virtual") // gcc complains about QObject::metaObject() being hidden.
+
 #include <QtCore/qhash.h>
 #include <QtCore/quuid.h>
 #include <QtCore/qfactoryinterface.h>
@@ -62,8 +67,6 @@ struct IUnknown;
 struct IDispatch;
 
 QT_BEGIN_NAMESPACE
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_GCC("-Woverloaded-virtual") // gcc complains about QObject::metaObject() being hidden.
 
 class QWidget;
 class QSettings;
@@ -331,8 +334,8 @@ private:
     } \
     QT_END_NAMESPACE
 
-QT_WARNING_POP
 QT_END_NAMESPACE
+QT_WARNING_POP
 
 #ifndef Q_COM_METATYPE_DECLARED
 #define Q_COM_METATYPE_DECLARED
-- 
GitLab