[Development] Q_OBJECT and "override"

Konstantin Ritt ritt.ks at gmail.com
Thu Jun 4 16:52:37 CEST 2015


#define Q_OBJECT \

public: \

    Q_OBJECT_CHECK \

    QT_WARNING_PUSH \

    Q_OBJECT_NO_OVERRIDE_WARNING \

    static const QMetaObject staticMetaObject; \

    virtual const QMetaObject *metaObject() const; \

    virtual void *qt_metacast(const char *); \

    virtual int qt_metacall(QMetaObject::Call, int, void **); \

    QT_WARNING_POP \

    QT_TR_FUNCTIONS \

private: \

    Q_DECL_HIDDEN_STATIC_METACALL static void
qt_static_metacall(QObject *, QMetaObject::Call, int, void **); \

    struct QPrivateSignal {};


Regards,
Konstantin

2015-06-04 17:27 GMT+03:00 Matthew Woehlke <mw_triad at users.sourceforge.net>:

> On 2015-06-04 08:12, Christian Kandeler wrote:
> > as anyone who uses clang has probably already noticed, this compiler has
> > recently added "-Winconsistent-missing-override" to the collection of
> > flags enabled via "-Wall".
>
> What happens if you (push state and) disable the warning at the start of
> the Q_OBJECT expansion, and pop state after?
>
> Ideally this would tell clang to not consider those functions for the
> purpose of the warning. (And maybe the clang developers would be
> amenable to making it work that way if it doesn't currently.)
>
> p.s. I don't use clang, but if I did I would probably have this switched
> on as an *error*. Thus, I at least would like to see a solution that
> doesn't involve turning it off globally.
>
> --
> Matthew
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150604/bab7f724/attachment.html>


More information about the Development mailing list