From aedc6d42ed31333ad84d505e0792ba0b1f8679cc Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Mon, 27 Aug 2018 10:54:09 +0200
Subject: [PATCH] Fix clang-tidy warnings about class definitions

- Use ' = default' for trivial constructors/destructors
- replace virtual by override or add override where applicable
- Replace trivial constructors by member initialization for simple structs
- Add Q_DISABLE_COPY or spell out deleted functions where only
  a copy constructor is implemented

Change-Id: I0b1610cb1425dd276a97df8179140c55f2e7b049
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
---
 src/activeqt/container/qaxbase.cpp     | 52 +++++++++++++-------------
 src/activeqt/container/qaxobject.h     |  2 +-
 src/activeqt/container/qaxscript.cpp   | 30 ++++++++-------
 src/activeqt/container/qaxscript.h     |  6 +--
 src/activeqt/container/qaxselect.cpp   |  9 ++---
 src/activeqt/container/qaxselect.h     |  2 +-
 src/activeqt/container/qaxwidget.cpp   | 30 ++++++++-------
 src/activeqt/container/qaxwidget.h     |  2 +-
 src/activeqt/control/qaxaggregated.h   |  9 +++--
 src/activeqt/control/qaxbindable.cpp   |  4 +-
 src/activeqt/control/qaxbindable.h     |  1 +
 src/activeqt/control/qaxfactory.cpp    |  6 +--
 src/activeqt/control/qaxfactory.h      |  3 +-
 src/activeqt/control/qaxserverbase.cpp | 42 +++++++++++++--------
 src/activeqt/control/qclassfactory_p.h | 18 +++++----
 15 files changed, 114 insertions(+), 102 deletions(-)

diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 25af9831..d1ea09c9 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -256,6 +256,7 @@ static const char *const type_conversion[][2] =
 
 class QAxEventSink : public IDispatch, public IPropertyNotifySink
 {
+    Q_DISABLE_COPY(QAxEventSink)
 public:
     QAxEventSink(QAxBase *com)
         : cpoint(0), ciid(IID_NULL), combase(com), ref(1)
@@ -327,11 +328,11 @@ public:
     }
 
     // IUnknown
-    unsigned long __stdcall AddRef()
+    unsigned long __stdcall AddRef() override
     {
         return InterlockedIncrement(&ref);
     }
-    unsigned long __stdcall Release()
+    unsigned long __stdcall Release() override
     {
         LONG refCount = InterlockedDecrement(&ref);
         if (!refCount)
@@ -339,7 +340,7 @@ public:
 
         return refCount;
     }
-    HRESULT __stdcall QueryInterface(REFIID riid, void **ppvObject)
+    HRESULT __stdcall QueryInterface(REFIID riid, void **ppvObject) override
     {
         *ppvObject = 0;
         if (riid == IID_IUnknown)
@@ -356,18 +357,17 @@ public:
     }
 
     // IDispatch
-    HRESULT __stdcall GetTypeInfoCount(unsigned int *) { return E_NOTIMPL; }
-    HRESULT __stdcall GetTypeInfo(UINT, LCID, ITypeInfo **) { return E_NOTIMPL; }
-    HRESULT __stdcall GetIDsOfNames(const _GUID &, wchar_t **, unsigned int, unsigned long, long *) { return E_NOTIMPL; }
-
-    HRESULT __stdcall Invoke(DISPID dispIdMember,
-                            REFIID riid,
-                            LCID,
-                            WORD wFlags,
-                            DISPPARAMS *pDispParams,
-                            VARIANT*,
-                            EXCEPINFO*,
-                            UINT*)
+    HRESULT __stdcall GetTypeInfoCount(unsigned int *) override
+    { return E_NOTIMPL; }
+    HRESULT __stdcall GetTypeInfo(UINT, LCID, ITypeInfo **) override
+    { return E_NOTIMPL; }
+    HRESULT __stdcall GetIDsOfNames(const _GUID &, wchar_t **, unsigned int,
+                                    unsigned long, long *) override
+    { return E_NOTIMPL; }
+
+    HRESULT __stdcall Invoke(DISPID dispIdMember, REFIID riid, LCID,
+                             WORD wFlags, DISPPARAMS *pDispParams,
+                             VARIANT *, EXCEPINFO *, UINT *) override
     {
         // verify input
         if (riid != IID_NULL)
@@ -496,7 +496,7 @@ public:
     QByteArray findProperty(DISPID dispID);
 
     // IPropertyNotifySink
-    HRESULT __stdcall OnChanged(DISPID dispID)
+    HRESULT __stdcall OnChanged(DISPID dispID) override
     {
         // verify input
         if (dispID == DISPID_UNKNOWN || !combase)
@@ -551,7 +551,7 @@ public:
         }
         return S_OK;
     }
-    HRESULT __stdcall OnRequestEdit(DISPID dispID)
+    HRESULT __stdcall OnRequestEdit(DISPID dispID) override
     {
         if (dispID == DISPID_UNKNOWN || !combase)
             return S_OK;
@@ -588,6 +588,7 @@ public:
 
 class QAxBasePrivate
 {
+    Q_DISABLE_COPY(QAxBasePrivate)
 public:
     typedef QHash<QUuid, QAxEventSink*> UuidEventSinkHash;
 
@@ -1616,11 +1617,9 @@ private:
     }
 
     struct Method {
-        Method() : flags(0)
-        {}
         QByteArray type;
         QByteArray parameters;
-        int flags;
+        int flags = 0;
         QByteArray realPrototype;
     };
     QMap<QByteArray, Method> signal_list;
@@ -4268,11 +4267,12 @@ QAxObject *QAxBase::querySubObject(const char *name, QList<QVariant> &vars)
 
 class QtPropertyBag : public IPropertyBag
 {
+    Q_DISABLE_COPY(QtPropertyBag)
 public:
     QtPropertyBag() :ref(0) {}
-    virtual ~QtPropertyBag() {}
+    virtual ~QtPropertyBag() = default;
 
-    HRESULT __stdcall QueryInterface(REFIID iid, LPVOID *iface)
+    HRESULT __stdcall QueryInterface(REFIID iid, LPVOID *iface) override
     {
         *iface = 0;
         if (iid == IID_IUnknown)
@@ -4285,11 +4285,11 @@ public:
         AddRef();
         return S_OK;
     }
-    unsigned long __stdcall AddRef()
+    unsigned long __stdcall AddRef() override
     {
         return InterlockedIncrement(&ref);
     }
-    unsigned long __stdcall Release()
+    unsigned long __stdcall Release() override
     {
         LONG refCount = InterlockedDecrement(&ref);
         if (!refCount)
@@ -4298,7 +4298,7 @@ public:
         return refCount;
     }
 
-    HRESULT __stdcall Read(LPCOLESTR name, VARIANT *var, IErrorLog *)
+    HRESULT __stdcall Read(LPCOLESTR name, VARIANT *var, IErrorLog *) override
     {
         if (!var)
             return E_POINTER;
@@ -4308,7 +4308,7 @@ public:
         QVariantToVARIANT(qvar, *var);
         return S_OK;
     }
-    HRESULT __stdcall Write(LPCOLESTR name, VARIANT *var)
+    HRESULT __stdcall Write(LPCOLESTR name, VARIANT *var) override
     {
         if (!var)
             return E_POINTER;
diff --git a/src/activeqt/container/qaxobject.h b/src/activeqt/container/qaxobject.h
index bebc60a7..587b532a 100644
--- a/src/activeqt/container/qaxobject.h
+++ b/src/activeqt/container/qaxobject.h
@@ -66,7 +66,7 @@ public:
     explicit QAxObject(QObject *parent = nullptr);
     explicit QAxObject(const QString &c, QObject *parent = nullptr);
     explicit QAxObject(IUnknown *iface, QObject *parent = nullptr);
-    ~QAxObject();
+    ~QAxObject() override;
 
     bool doVerb(const QString &verb);
 
diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp
index e2768d00..a209df5a 100644
--- a/src/activeqt/container/qaxscript.cpp
+++ b/src/activeqt/container/qaxscript.cpp
@@ -97,26 +97,28 @@ public:
 
 class QAxScriptSite : public IActiveScriptSite, public IActiveScriptSiteWindow
 {
+    Q_DISABLE_COPY(QAxScriptSite)
 public:
     QAxScriptSite(QAxScript *script);
-    virtual ~QAxScriptSite() {}
+    virtual ~QAxScriptSite() = default;
 
-    ULONG WINAPI AddRef();
-    ULONG WINAPI Release();
-    HRESULT WINAPI QueryInterface(REFIID iid, void **ppvObject);
+    ULONG WINAPI AddRef() override;
+    ULONG WINAPI Release() override;
+    HRESULT WINAPI QueryInterface(REFIID iid, void **ppvObject) override;
 
-    HRESULT WINAPI GetLCID(LCID *plcid);
-    HRESULT WINAPI GetItemInfo(LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti);
-    HRESULT WINAPI GetDocVersionString(BSTR *pbstrVersion);
+    HRESULT WINAPI GetLCID(LCID *plcid) override;
+    HRESULT WINAPI GetItemInfo(LPCOLESTR pstrName, DWORD dwReturnMask,
+                               IUnknown **ppiunkItem, ITypeInfo **ppti) override;
+    HRESULT WINAPI GetDocVersionString(BSTR *pbstrVersion) override;
 
-    HRESULT WINAPI OnScriptTerminate(const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo);
-    HRESULT WINAPI OnStateChange(SCRIPTSTATE ssScriptState);
-    HRESULT WINAPI OnScriptError(IActiveScriptError *pscripterror);
-    HRESULT WINAPI OnEnterScript();
-    HRESULT WINAPI OnLeaveScript();
+    HRESULT WINAPI OnScriptTerminate(const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo) override;
+    HRESULT WINAPI OnStateChange(SCRIPTSTATE ssScriptState) override;
+    HRESULT WINAPI OnScriptError(IActiveScriptError *pscripterror) override;
+    HRESULT WINAPI OnEnterScript() override;
+    HRESULT WINAPI OnLeaveScript() override;
 
-    HRESULT WINAPI GetWindow(HWND *phwnd);
-    HRESULT WINAPI EnableModeless(BOOL fEnable);
+    HRESULT WINAPI GetWindow(HWND *phwnd) override;
+    HRESULT WINAPI EnableModeless(BOOL fEnable) override;
 
 protected:
     QWidget *window() const;
diff --git a/src/activeqt/container/qaxscript.h b/src/activeqt/container/qaxscript.h
index f09b2fcc..17449d49 100644
--- a/src/activeqt/container/qaxscript.h
+++ b/src/activeqt/container/qaxscript.h
@@ -77,7 +77,7 @@ public:
     };
 
     QAxScriptEngine(const QString &language, QAxScript *script);
-    ~QAxScriptEngine();
+    ~QAxScriptEngine() override;
 
     bool isValid() const;
     bool hasIntrospection() const;
@@ -112,7 +112,7 @@ public:
     };
 
     QAxScript(const QString &name, QAxScriptManager *manager);
-    ~QAxScript();
+    ~QAxScript() override;
 
     bool load(const QString &code, const QString &language = QString());
 
@@ -160,7 +160,7 @@ class QAxScriptManager : public QObject
 
 public:
     explicit QAxScriptManager(QObject *parent = nullptr);
-    ~QAxScriptManager();
+    ~QAxScriptManager() override;
 
     void addObject(QAxBase *object);
     void addObject(QObject *object);
diff --git a/src/activeqt/container/qaxselect.cpp b/src/activeqt/container/qaxselect.cpp
index 81afa517..1b860e76 100644
--- a/src/activeqt/container/qaxselect.cpp
+++ b/src/activeqt/container/qaxselect.cpp
@@ -71,17 +71,16 @@ enum ControlType { InProcessControl, OutOfProcessControl };
 
 struct Control
 {
-    inline Control() : type(InProcessControl), wordSize(0) {}
     int compare(const Control &rhs) const;
     QString toolTip() const;
 
-    ControlType type;
+    ControlType type = InProcessControl;
     QString clsid;
     QString name;
     QString dll;
     QString version;
     QString rootKey;
-    unsigned wordSize;
+    unsigned wordSize = 0;
 };
 
 inline int Control::compare(const Control &rhs) const
@@ -379,9 +378,7 @@ QAxSelect::QAxSelect(QWidget *parent, Qt::WindowFlags flags)
 /*!
     Destroys the QAxSelect object.
 */
-QAxSelect::~QAxSelect()
-{
-}
+QAxSelect::~QAxSelect() = default;
 
 /*!
     \fn QString QAxSelect::clsid() const
diff --git a/src/activeqt/container/qaxselect.h b/src/activeqt/container/qaxselect.h
index 54552d9b..d17de955 100644
--- a/src/activeqt/container/qaxselect.h
+++ b/src/activeqt/container/qaxselect.h
@@ -62,7 +62,7 @@ class QAxSelect : public QDialog
     Q_OBJECT
 public:
     explicit QAxSelect(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
-    ~QAxSelect();
+    ~QAxSelect() override;
     QString clsid() const;
 
 private Q_SLOTS:
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index 07315cf6..b25e4b21 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -115,11 +115,12 @@ QT_BEGIN_NAMESPACE
 */
 class QAxHostWidget : public QWidget
 {
+    Q_DISABLE_COPY(QAxHostWidget)
     friend class QAxClientSite;
 public:
     Q_OBJECT_CHECK
     QAxHostWidget(QWidget *parent, QAxClientSite *ax);
-    ~QAxHostWidget();
+    ~QAxHostWidget() override;
 
     QSize sizeHint() const override;
     QSize minimumSizeHint() const override;
@@ -173,6 +174,7 @@ class QAxClientSite : public IDispatch,
                     public IOleDocumentSite,
                     public IAdviseSink
 {
+    Q_DISABLE_COPY(QAxClientSite)
     friend class QAxHostWidget;
 public:
     QAxClientSite(QAxWidget *c);
@@ -209,22 +211,22 @@ public:
     }
 
     // IUnknown
-    unsigned long WINAPI AddRef();
-    unsigned long WINAPI Release();
+    unsigned long WINAPI AddRef() override;
+    unsigned long WINAPI Release() override;
     STDMETHOD(QueryInterface)(REFIID iid, void **iface);
 
     // IDispatch
-    HRESULT __stdcall GetTypeInfoCount(unsigned int *) { return E_NOTIMPL; }
-    HRESULT __stdcall GetTypeInfo(UINT, LCID, ITypeInfo **) { return E_NOTIMPL; }
-    HRESULT __stdcall GetIDsOfNames(const _GUID &, wchar_t **, unsigned int, unsigned long, long *) { return E_NOTIMPL; }
-    HRESULT __stdcall Invoke(DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
+    HRESULT __stdcall GetTypeInfoCount(unsigned int *) override
+    { return E_NOTIMPL; }
+    HRESULT __stdcall GetTypeInfo(UINT, LCID, ITypeInfo **) override
+    { return E_NOTIMPL; }
+    HRESULT __stdcall GetIDsOfNames(const _GUID &, wchar_t **, unsigned int,
+                                    unsigned long, long *) override
+    { return E_NOTIMPL; }
+    HRESULT __stdcall Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
+                             WORD wFlags, DISPPARAMS *pDispParams,
+                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
+                             UINT *puArgErr) override;
     void emitAmbientPropertyChange(DISPID dispid);
 
     // IOleClientSite
diff --git a/src/activeqt/container/qaxwidget.h b/src/activeqt/container/qaxwidget.h
index db1f73a9..49caa229 100644
--- a/src/activeqt/container/qaxwidget.h
+++ b/src/activeqt/container/qaxwidget.h
@@ -72,7 +72,7 @@ public:
     explicit QAxWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
     explicit QAxWidget(const QString &c, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
     explicit QAxWidget(IUnknown *iface, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
-    ~QAxWidget();
+    ~QAxWidget() override;
 
     void clear() override;
     bool doVerb(const QString &verb);
diff --git a/src/activeqt/control/qaxaggregated.h b/src/activeqt/control/qaxaggregated.h
index 21add508..61d1f7f7 100644
--- a/src/activeqt/control/qaxaggregated.h
+++ b/src/activeqt/control/qaxaggregated.h
@@ -65,12 +65,13 @@ class QAxAggregated
 {
     friend class QAxServerBase;
     friend class QAxClientSite;
+    Q_DISABLE_COPY(QAxAggregated)
 public:
     virtual long queryInterface(const QUuid &iid, void **iface) = 0;
 
 protected:
-    virtual ~QAxAggregated()
-    {}
+    QAxAggregated() = default;
+    virtual ~QAxAggregated() = default;
 
     inline IUnknown *controllingUnknown() const
     { return controlling_unknown; }
@@ -78,8 +79,8 @@ protected:
     inline QObject *object() const { return the_object; }
 
 private:
-    IUnknown *controlling_unknown;
-    QObject *the_object;
+    IUnknown *controlling_unknown = nullptr;
+    QObject *the_object = nullptr;
 };
 
 #define QAXAGG_IUNKNOWN \
diff --git a/src/activeqt/control/qaxbindable.cpp b/src/activeqt/control/qaxbindable.cpp
index 6857c401..2bb1ffe3 100644
--- a/src/activeqt/control/qaxbindable.cpp
+++ b/src/activeqt/control/qaxbindable.cpp
@@ -102,9 +102,7 @@ QAxBindable::QAxBindable()
 /*!
     Destroys the QAxBindable object.
 */
-QAxBindable::~QAxBindable()
-{
-}
+QAxBindable::~QAxBindable() = default;
 
 /*!
     Call this function to request permission to change the property
diff --git a/src/activeqt/control/qaxbindable.h b/src/activeqt/control/qaxbindable.h
index 1bb3b0c4..c5d26301 100644
--- a/src/activeqt/control/qaxbindable.h
+++ b/src/activeqt/control/qaxbindable.h
@@ -63,6 +63,7 @@ struct IAxServerBase;
 
 class QAxBindable
 {
+    Q_DISABLE_COPY(QAxBindable)
     friend class QAxServerBase;
 public:
     QAxBindable();
diff --git a/src/activeqt/control/qaxfactory.cpp b/src/activeqt/control/qaxfactory.cpp
index 1f101fed..1a999aab 100644
--- a/src/activeqt/control/qaxfactory.cpp
+++ b/src/activeqt/control/qaxfactory.cpp
@@ -113,9 +113,7 @@ QAxFactory::QAxFactory(const QUuid &libid, const QUuid &appid)
 /*!
     Destroys the QAxFactory object.
 */
-QAxFactory::~QAxFactory()
-{
-}
+QAxFactory::~QAxFactory() = default;
 
 /*!
     \fn QUuid QAxFactory::typeLibID() const
@@ -462,7 +460,7 @@ class ActiveObject : public QObject
 {
 public:
     ActiveObject(QObject *parent, QAxFactory *factory);
-    ~ActiveObject();
+    ~ActiveObject() override;
 
     IDispatch *wrapper;
     DWORD cookie;
diff --git a/src/activeqt/control/qaxfactory.h b/src/activeqt/control/qaxfactory.h
index 0ba62b07..342017e2 100644
--- a/src/activeqt/control/qaxfactory.h
+++ b/src/activeqt/control/qaxfactory.h
@@ -74,9 +74,10 @@ class QSettings;
 
 class QAxFactory : public QObject
 {
+    Q_DISABLE_COPY(QAxFactory)
 public:
     QAxFactory(const QUuid &libId, const QUuid &appId);
-    virtual ~QAxFactory();
+    ~QAxFactory() override;
 
     virtual QStringList featureList() const = 0;
 
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index 5d79a87f..30ea1dc6 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -175,7 +175,7 @@ public:
 
     void init();
 
-    ~QAxServerBase();
+    ~QAxServerBase() override;
 
 // Window creation
     HWND create(HWND hWndParent, RECT& rcPos);
@@ -190,14 +190,14 @@ public:
     void revokeActiveObject();
 
 // IUnknown
-    unsigned long WINAPI AddRef()
+    unsigned long WINAPI AddRef() override
     {
         if (m_outerUnknown)
             return m_outerUnknown->AddRef();
 
         return InterlockedIncrement(&ref);
     }
-    unsigned long WINAPI Release()
+    unsigned long WINAPI Release() override
     {
         if (m_outerUnknown)
             return m_outerUnknown->Release();
@@ -208,25 +208,26 @@ public:
 
         return refCount;
     }
-    HRESULT WINAPI QueryInterface(REFIID iid, void **iface);
+    HRESULT WINAPI QueryInterface(REFIID iid, void **iface) override;
     HRESULT InternalQueryInterface(REFIID iid, void **iface);
 
 // IAxServerBase
-    IUnknown *clientSite() const
+    IUnknown *clientSite() const override
     {
         return m_spClientSite;
     }
 
-    void emitPropertyChanged(const char*);
-    bool emitRequestPropertyChange(const char*);
-    QObject *qObject() const
+    void emitPropertyChanged(const char *) override;
+    bool emitRequestPropertyChange(const char *) override;
+    QObject *qObject() const override
     {
         return theObject;
     }
     void ensureMetaData();
     bool isPropertyExposed(int index);
 
-    void reportError(int code, const QString &src, const QString &desc, const QString &context)
+    void reportError(int code, const QString &src, const QString &desc,
+                     const QString &context) override
     {
         if (exception)
             delete exception;
@@ -355,9 +356,9 @@ public:
     STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppenumAdvise);
 
 // QObject
-    int qt_metacall(QMetaObject::Call, int index, void **argv);
+    int qt_metacall(QMetaObject::Call, int index, void **argv) override;
 
-    bool eventFilter(QObject *o, QEvent *e);
+    bool eventFilter(QObject *o, QEvent *e) override;
 
     RECT rcPosRect() const
     {
@@ -448,6 +449,7 @@ static inline QAxServerBase *axServerBaseFromWindow(HWND hWnd)
 
 class QAxServerAggregate : public IUnknown
 {
+    Q_DISABLE_COPY(QAxServerAggregate)
 public:
     QAxServerAggregate(const QString &className, IUnknown *outerUnknown)
         : ref(0)
@@ -467,11 +469,11 @@ public:
     }
 
 // IUnknown
-    unsigned long WINAPI AddRef()
+    unsigned long WINAPI AddRef() override
     {
         return InterlockedIncrement(&ref);
     }
-    unsigned long WINAPI Release()
+    unsigned long WINAPI Release() override
     {
         LONG refCount = InterlockedDecrement(&ref);
         if (!refCount)
@@ -479,7 +481,7 @@ public:
 
         return refCount;
     }
-    HRESULT WINAPI QueryInterface(REFIID iid, void **iface)
+    HRESULT WINAPI QueryInterface(REFIID iid, void **iface) override
     {
         *iface = 0;
 
@@ -518,6 +520,10 @@ bool QAxFactory::createObjectWrapper(QObject *object, IDispatch **wrapper)
 class QAxSignalVec : public IEnumConnectionPoints
 {
 public:
+    QAxSignalVec &operator=(const QAxSignalVec &) = delete;
+    QAxSignalVec &operator=(QAxSignalVec &&) = delete;
+    QAxSignalVec(QAxSignalVec &&) = delete;
+
     QAxSignalVec(const QAxServerBase::ConnectionPoints &points)
         : cpoints(points.values())
         , current(0)
@@ -638,6 +644,10 @@ class QAxConnection : public IConnectionPoint,
                       public IEnumConnections
 {
 public:
+    QAxConnection &operator=(const QAxConnection &) = delete;
+    QAxConnection(QAxConnection &&) = delete;
+    QAxConnection &operator=(QAxConnection &&) = delete;
+
     typedef QList<CONNECTDATA> Connections;
     typedef QList<CONNECTDATA>::Iterator Iterator;
 
@@ -662,11 +672,11 @@ public:
         DeleteCriticalSection(&refCountSection);
     }
 
-    unsigned long __stdcall AddRef()
+    unsigned long __stdcall AddRef() override
     {
         return InterlockedIncrement(&ref);
     }
-    unsigned long __stdcall Release()
+    unsigned long __stdcall Release() override
     {
         LONG refCount = InterlockedDecrement(&ref);
         if (!refCount)
diff --git a/src/activeqt/control/qclassfactory_p.h b/src/activeqt/control/qclassfactory_p.h
index 4a5944a9..86fea60d 100644
--- a/src/activeqt/control/qclassfactory_p.h
+++ b/src/activeqt/control/qclassfactory_p.h
@@ -71,28 +71,30 @@ QT_BEGIN_NAMESPACE
 // One instance of this class for each ActiveX the server can provide.
 class QClassFactory : public IClassFactory2
 {
+    Q_DISABLE_COPY(QClassFactory)
 public:
     QClassFactory(CLSID clsid);
 
     virtual ~QClassFactory();
 
     // IUnknown
-    unsigned long WINAPI AddRef();
-    unsigned long WINAPI Release();
-    HRESULT WINAPI QueryInterface(REFIID iid, LPVOID *iface);
+    unsigned long WINAPI AddRef() override;
+    unsigned long WINAPI Release() override;
+    HRESULT WINAPI QueryInterface(REFIID iid, LPVOID *iface) override;
 
     HRESULT WINAPI CreateInstanceHelper(IUnknown *pUnkOuter, REFIID iid, void **ppObject);
 
     // IClassFactory
-    HRESULT WINAPI CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppObject);
+    HRESULT WINAPI CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppObject) override;
 
-    HRESULT WINAPI LockServer(BOOL fLock);
+    HRESULT WINAPI LockServer(BOOL fLock) override;
     // IClassFactory2
-    HRESULT WINAPI RequestLicKey(DWORD, BSTR *pKey);
+    HRESULT WINAPI RequestLicKey(DWORD, BSTR *pKey) override;
 
-    HRESULT WINAPI GetLicInfo(LICINFO *pLicInfo);
+    HRESULT WINAPI GetLicInfo(LICINFO *pLicInfo) override;
 
-    HRESULT WINAPI CreateInstanceLic(IUnknown *pUnkOuter, IUnknown * /* pUnkReserved */, REFIID iid, BSTR bKey, PVOID *ppObject);
+    HRESULT WINAPI CreateInstanceLic(IUnknown *pUnkOuter, IUnknown *pUnkReserved,
+                                     REFIID iid, BSTR bKey, PVOID *ppObject) override;
 
     static void cleanupCreatedApplication(QCoreApplication &app);
 
-- 
GitLab