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
Highlighted
Developer
Posts: 361
Registered: ‎01-22-2014
My Device: BlackBerry Z30
My Carrier: giffgaff

How to inhibit the Screensaver on BlackBerry 10 native

Hello,

 

I'm trying to stop the device auto locking when the light times out on BlackBerry 10, I'm a little stuck with BB10 not supporting QMobility Classes.

 

I'm not using Cascades components, I am on a custom Qt/Qt Quick project with my own UI ect.

 

Which is the problem, I don't define a Application I use  QDeclarativeView and set the source that way.

 

Does anyone know how I can implement the native c++ method of inhibiting the screensaver/light time out into my code?

 

Only have this at the moment:

 

#include <QtGui/QApplication>
#include <QtDeclarative/QDeclarativeView>
#include <QtDeclarative/QDeclarativeEngine>
#include <QDeclarativeProperty>
#include <QDeclarativeItem>
#include <QDebug>
#include <QObject>


int main(int argc, char *argv[])
{


    QApplication application(argc, argv);

    QDeclarativeView view;

    view.setSource(QUrl("app/native/assets/main.qml"));
    view.setResizeMode(QDeclarativeView:Smiley FrustratedizeRootObjectToView);

    QObject::connect(view.engine(),
                    SIGNAL(quit()),
                    qApp,
                    SLOT(quit()));
         view.window()->show();
        return application.exec();

}

 

I'm coming from Symbian so I'm a little confused on what will work or what won't at the moment.

 

Thanks