[Interest] Understanding Qt Macros

Alejandro Exojo suy at badopi.org
Sat Jan 3 14:40:49 CET 2015


El Saturday 03 January 2015, Reinhardt Behm escribió:
> I have used them to put together a commonly used header (see attached 
> project.h), that I also use as a precompiled header.
> This way all the required <Qt...> headers are automatically included.

Why do such thing? Adding a `using namespace std` in a common header seems 
like a terrible idea to begin with. You should import namespaces only when you 
need them, and as much scoped as you can. Or just using what you want (`using 
std::cout` if you only use that). Seems a recipe for future name clashes that 
will give strange compilation errors if you use reasonably name variables.

Including all the Qt headers is something that I don't understand either. Even 
with precompiled headers.

-- 
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net



More information about the Interest mailing list