Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to blank/restore QWSScreenSaver ?
Qt 6.11 is out! See what's new in the release blog

How to blank/restore QWSScreenSaver ?

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jinxxy
    wrote on last edited by
    #1

    I am trying to get QWSScreenSaver to blank and restore my screen.
    I have tried a few different ways, but each time I seem to get stuck.
    Can anyone offer any advice on how to achieve this?
    Can I emit a signal from the screensaver that gets connected to my application and performs hide() and show().
    Or can I do this directly in the restore() and save() of the QWSScreenSaver?

    I would appreciate any pointers :-)

    My main is shown below

    @class SimpleScreenSaver : public QWSScreenSaver
    {
    public:
    void restore()
    {
    qDebug("SimpleScreenSaver::restore");
    // //Repaint the screen
    // //Turn the backlight on
    // ??
    };

    bool save(int level)
    {
    qDebug("SimpleScreenSaver::save");
    // //Blank the screen
    // ??
    // //Turn the backlight off
    // ??
    return true;
    };

    protected:
    };
    #endif

    int main(int argc, char argv[])
    {
    /
    Create application */
    QApplication app(argc, argv);
    QWSServer::setCursorVisible(false);

    /* Setup screen saver */
    QWSServer::setScreenSaver(new SimpleScreenSaver);
    QWSServer::setScreenSaverInterval(15000);
    QWSServer::setScreenSaverBlockLevel(0);

    MainDialog *maindialog = new MainDialog;
    

    maindialog->show();

    /* Run application */
    int ret = app.exec();

    /* Cleanup */
    QWSServer::screenSaverActivate(false);
    return ret;
    @

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kchandr7
      wrote on last edited by
      #2

      Jinxxy,

      Were you able to get this working? Would like to know because I'm trying to do the save thing.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved