您的位置:首页 > 其它

预编译器

2016-01-06 10:13 337 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: