Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Qt on BlackBerry and QNX
  4. [SOLVED] Idle mode using native sdk
Forum Update on Monday, May 27th 2025

[SOLVED] Idle mode using native sdk

Scheduled Pinned Locked Moved Qt on BlackBerry and QNX
2 Posts 1 Posters 2.8k Views
  • 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.
  • A Offline
    A Offline
    AlterX
    wrote on 24 May 2014, 13:36 last edited by
    #1

    Hello,
    I am in process of creation of an app using Qt 5.2.1 so I cannot rely on Official BB Qt components.
    So, as I have done for vibration (that works), I am trying to do the same for screen idle, but without success; this is my code (extracted on official bb example):
    @
    screen_context_t screen_ctx;
    screen_window_t window_id;

    screen_create_context(&screen_ctx, SCREEN_APPLICATION_CONTEXT);
    screen_create_window(&window_id, screen_ctx);
    

    screen_set_window_property_iv(window_id, SCREEN_PROPERTY_IDLE_MODE,SCREEN_IDLE_MODE_KEEP_AWAKE);
    screen_destroy_window(window_id);
    screen_destroy_context(screen_ctx);
    @

    This doesn't work!

    Qt Ambassador
    Real-time cooperative teams: http://www.softairrealfight.net
    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

    https://codereview.qt-project.org/...

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AlterX
      wrote on 26 May 2014, 10:34 last edited by
      #2

      For those who need to work this job out, you can just use:
      @
      int idle = inhibit ? SCREEN_IDLE_MODE_KEEP_AWAKE : SCREEN_IDLE_MODE_NORMAL;

      screen_set_window_property_iv((screen_window_t)myWinId, SCREEN_PROPERTY_IDLE_MODE, &idle);
      @

      myWinId is just a QWindow's function (inherited by QQuickWindow, QmlApplicationViewer and so on...)

      Qt Ambassador
      Real-time cooperative teams: http://www.softairrealfight.net
      Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

      https://codereview.qt-project.org/...

      1 Reply Last reply
      0

      1/2

      24 May 2014, 13:36

      • Login

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