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
Contributor
Posts: 41
Registered: ‎09-14-2012
My Device: Playbook 64Gb
My Carrier: n/a

Screen brightness control

Hi

 

Does the NDK (for PlayBook) expose a method of controlling screen brightness that would be accessible to a Qt program? In the API documentation I've seen some fuctions that seem to be related to brightness control, but they all appear to refer to data structures that don't seem to be accessible to a Qt program.

 

Thanks.

 

Best wishes

Kevin

Contributor
Posts: 24
Registered: ‎09-10-2012
My Device: Blackberry Dev Alpha
My Carrier: -

Re: Screen brightness control

Qt doesn't have a function to control brightness, you'd have to use the NDK functions for this.

Out of interest, what functions for adjusting brightness did you find?

Contributor
Posts: 41
Registered: ‎09-14-2012
My Device: Playbook 64Gb
My Carrier: n/a

Re: Screen brightness control

I'm looking at

 

screen_set_window_property (SCREEN_PROPERTY_BRIGHTNESS...)

 

but I don't know if that applies to the whole screen, or just to a native window. I'm not sure how you can set the brighness of a specific window, unless the documentation is using the word 'brightness' to mean something different from what I understand. In any event, the function takes a screen_window_t argument, and I have no idea how to get that within a Qt application, or if it's even possible to.

Contributor
Posts: 24
Registered: ‎09-10-2012
My Device: Blackberry Dev Alpha
My Carrier: -

Re: Screen brightness control

screen_set_window_property (SCREEN_PROPERTY_BRIGHTNESS...) is indeed only for a single window, and not for the whole screen. I haven't found an API yet to control the screen brightness.

SCREEN_PROPERTY_BRIGHTNESS doesn't work anyway, apparently the specific GPU doesn't support it.

 

As for getting the screen_window_t from a Qt window, there is no support for that at the moment, though it could be added to QPlatformNativeInterface of the Blackberry plugin.

 

 

Highlighted
Contributor
Posts: 15
Registered: ‎10-25-2012
My Device: Dev Alpha B
My Carrier: Megafon

Re: Screen brightness control


mcguire wrote:

As for getting the screen_window_t from a Qt window, there is no support for that at the moment

 

 


 

Maybe application.mainWindow()->handle() will help to get screen_window_t. But screen_set_window_property_iv with SCREEN_PROPERTY_BRIGHTNESS seems doesn't have any visual effect