PDA

View Full Version : How to know the Qt Version of a given Qt component?



Momergil
15th July 2013, 05:26
Hello!

Talking about QT_VERSION macro here: [http://www.qtcentre.org/threads/55390-Qt-usage-macro?p=247602#post247602], I ended up having a question regarding knowledge of Qt versions and their relation with specific Qt components, namely, how exactly does I know which is the minimal Qt Version that a given Qt thing requires to be used? Some functions in Qt Assistant do say "this feature was introduced in Qt ...", but this is not regular. For example, how do I know which is the minimal Qt Version that it's required for QMessageBox to be used?

And I got a related question: is there a way by which I can detect if a given header was #include or not? I mean, we can detect if a macro was already defined my using #ifndef:



#ifndef MACRO
#define MACRO
#endif


Is there a way to do a analogous thing regarding header #include?


Thanks,

Momergil

Ginsengelf
15th July 2013, 08:19
Hi, I think it is safe to assume that all functions that are not marked as "introduced in Qt 4.x" are available for all Qt 4 versions.

Most headers use include guards that work the same way as you macro example.

Ginsengelf