Preferred way to test for a Qt feature?

Andreas Pakulat apaku at gmx.de
Sun Aug 24 11:00:57 CEST 2008


On 24.08.08 18:46:18, Brad Hards wrote:
> I'm planning to add a feature that depends on a particular feature in Qt 4.5.
> 
> Obviously I don't want to break current compilation with Qt 4.5
> 
> Should I write a specific test for the required class, or can I just work off 
> the Qt version?

I think that depends on how that feature is available in Qt itself. If
it is possible to configure Qt to disable that feature Qt most probably
provides means to know it has been disabled. Else a version check is
just fine. This is for example available for the graphicsview support,
if that is disabled in Qt there's a define thats set:
QT_NO_GRAPHICSVIEW. So just inspect the header thats providing the
class/feature.

Andreas

-- 
You have an unusual understanding of the problems of human relationships.


More information about the Kde-buildsystem mailing list