The OrientationLock class exports orientation lock related properties to QML It has two properties:
More...
#include <plugins/Lomiri/Session/orientationlock.h>
Inherits QObject.
|
void | enabledChanged () |
|
void | savedOrientationChanged () |
|
The OrientationLock class exports orientation lock related properties to QML It has two properties:
- readonly boolean with the Orientation lock property state
- Qt::ScreenOrientation to save the locked orientation state across Sessions (only relevant if lock is true)
Definition at line 29 of file orientationlock.h.
◆ OrientationLock()
OrientationLock::OrientationLock |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
Definition at line 22 of file orientationlock.cpp.
23 : QObject(parent)
24 , m_enabled(false)
25 , m_savedOrientation(Qt::PortraitOrientation)
26{
27 m_systemSettings = g_settings_new("com.lomiri.touch.system");
28 g_signal_connect(m_systemSettings, "changed::rotation-lock",
29 G_CALLBACK(OrientationLock::onEnabledChangedProxy), this);
30 m_enabled = g_settings_get_boolean(m_systemSettings, "rotation-lock");
31}
◆ ~OrientationLock()
OrientationLock::~OrientationLock |
( |
| ) |
|
Definition at line 33 of file orientationlock.cpp.
34{
35 g_signal_handlers_disconnect_by_data(m_systemSettings, this);
36 g_object_unref(m_systemSettings);
37}
◆ enabled()
bool OrientationLock::enabled |
( |
| ) |
const |
◆ savedOrientation()
Qt::ScreenOrientation OrientationLock::savedOrientation |
( |
| ) |
const |
◆ setSavedOrientation()
void OrientationLock::setSavedOrientation |
( |
const Qt::ScreenOrientation |
orientation | ) |
|
Definition at line 64 of file orientationlock.cpp.
65{
66 if (orientation == m_savedOrientation) {
67 return;
68 }
69
70 m_savedOrientation = orientation;
71
72
73 Q_EMIT savedOrientationChanged();
74}
◆ enabled
bool OrientationLock::enabled |
|
read |
◆ savedOrientation
Qt::ScreenOrientation OrientationLock::savedOrientation |
|
readwrite |
The documentation for this class was generated from the following files: