What is Qt's macro "Q_OVERRIDE" used for?
I find this macro by accident. By curiosity, I want to know how this macro used, better to give me a code snippet.
where did you find this macro?
I only know Q_DECL_OVERRIDE and this was used to introduce the C++11 override keyword while keeping compatibility to non-C++11 compilers.
On a non-C++11 compiler it is defined as nothing. Nowadays (Qt 5.7+) C++11 is always required and the macro is gradually replaced with override.
You can find this macro.
But this macro has one argument, I guess it is not used to be compatible with STD C++ 11 override.
The macro was added in 6c54e10. Looks like it evaluates to nothing, and was intended to provide meta data for auto-documenting tools?
Seems it never got used beyond a couple of properties in