Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 145
Registered: ‎12-23-2012
My Device: BB10 Dev Alpha
My Carrier: wifi
Accepted Solution

Disabling display dimming

Hi,

 

I am creating one game, in that I am using intreaction model other than touch.

 

But phone display get dimmed/black if i dont touch it for sometime.

 

How can i avoid this display dimming ?

 

Thanks 

Highlighted
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Disabling display dimming

See this thread: http://supportforums.blackberry.com/t5/Cascades-Development/prevent-a-screen-lock/m-p/2129125


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 145
Registered: ‎12-23-2012
My Device: BB10 Dev Alpha
My Carrier: wifi

Re: Disabling display dimming

I found soulution,

 

QScopedPointer<QDeclarativeView> view(new QDeclarativeView());

int idle_mode = SCREEN_IDLE_MODE_KEEP_AWAKE;
WId winId = view->winId();
screen_set_window_property_iv(screen_window_t(winId), SCREEN_PROPERTY_IDLE_MODE,&idle_mode);

 

This works for me with pure Qt application