Ask / Submit

QML noob question: Alter default bool

asked 2019-05-17 22:08:09 +0300

Sunny gravatar image

updated 2019-05-17 22:18:32 +0300


unfortunately I know exactly nothing about QML. Syntax isn't completely cryptic to me, but I'm stuck finding out where some kind of initialization happens after declaration (which I think I found - if one can compare runtime prototype definition and variable declaration... sorry for this ugly blending, I don't speak QML or any other object oriented language well/at all).

So I see that e.g. DisplaySettings.lidSensorEnabled is true by default, as opposed to DisplaySettings.lowPowerModeEnabled.

I guess the setting is predefined in lib/, so at compile time. Is there a way to change the bool at system startup time?

Thanks, -harry

edit retag flag offensive close delete


1 Answer

Sort by » oldest newest most voted

answered 2019-05-18 08:43:37 +0300

spiiroin gravatar image

Under the hood DisplaySettings.lidSensorEnabled is mapped to mce setting, i.e. toggling the bool value from qml does the same thing as running mcetool from cli:

mcetool  --set-lid-sensor-mode=<enabled|disabled>

Note that the value persists over application / device restarts. The initial value of the QML property should reflect whatever the underlying setting value is, i.e. it is not always True by default.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools



Asked: 2019-05-17 22:08:09 +0300

Seen: 142 times

Last updated: yesterday