<div dir="ltr"><p dir="ltr">Hello,</p><p dir="ltr">I experience an issue with req_display_blanking_pause dbus call.</p><p dir="ltr">I have `QT += dbus` line in the .pro file and my code is the following:</p>
<p>In tools.h:</p><p dir="ltr">Q_INVOKABLE void setBlankingMode(bool state);</p><p>tools.cpp:</p>
<p dir="ltr">#include "tools.h"<br>#include <QDebug><br>#include <QDBusConnection><br>#include <QDBusInterface><br></p><p dir="ltr">// true - screen blanks (default)<br>// false - no blanking<br>void Tools::setBlankingMode(bool state)<br>{<br>    QDBusConnection system = QDBusConnection::connectToBus(QDBusConnection::SystemBus, "system");<br>    QDBusInterface interface("com.nokia.mce", "/com/nokia/mce/request", "com.nokia.mce.request", system);<br><br>    if (state) {<br>        qDebug() << "Screen blanking turned on";<br>        interface.call(QLatin1String("req_display_cancel_blanking_pause"));<br>    } else {<br>        qDebug() << "Screen blanking turned off";<br>        interface.call(QLatin1String("req_display_blanking_pause"));<br>    }<br>}</p>
<p dir="ltr">In main function:</p>
<p dir="ltr">Tools* tools = new Tools();<br>
view->rootContext()->setContextProperty("cpptools", tools);</p>
<p dir="ltr">But screen keeps going blank after I call cpptools.setBlankingMode(false) from QML (tested on Sailfish OS 1.1.9.28). What can be the problem?</p>
<p dir="ltr">Thanks in advance,<br>
Andrew Penkrat</p>
</div>