Q_DECL_OVERRIDE
This macro can be used to declare an overriding virtual function. Use of this markup will allow the compiler to generate an error if the overriding virtual function does not in fact override anything.
It expands to “override” if your compiler supports that C++11 contextual keyword, or to nothing otherwise.
The macro goes at the end of the function, usually after the const, if any:
// generate error if this doesn’t actually override anything:
virtual void MyWidget::paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
This function was introduced in Qt 5.0.