Important: Please read the Qt Code of Conduct -

[SOLVED] QSystemScreenSaver

  • I'm trying to stop the screensaver when my app is in the foreground.

    I followed the code snippet from the link above, but still, I'm getting compile errors 'QSystemScreenSaver' does not name a type.

    I use Qt SDK 1.1 beta on Windows 7.

  • The compiler can't find QSystemScreenSaver class declaration. Make sure your code has include line like this before using QSystemScreenSaver class:

    @#include <QSystemScreenSaver>@

    You also need to specify QtMobility namespace, that blog article does not mention it for some reason, so make sure there is a macro line like this after the include line:


    Make also sure you have lines like this in your .pro file

    @CONFIG += mobility
    MOBILITY += systeminfo@

  • tnx, it works now.

Log in to reply