mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
example 'meshtastic': review WiFi mode
This commit is contained in:
parent
df62fd4a21
commit
5e16e9594e
7 changed files with 90 additions and 45 deletions
|
|
@ -106,12 +106,16 @@ QT::QT() : QObject() {
|
|||
// background mode
|
||||
QObject::connect(qGuiApp, &QGuiApplication::applicationStateChanged,
|
||||
[&](Qt::ApplicationState state) {
|
||||
static bool ok = false; // for startup
|
||||
if (state == Qt::ApplicationInactive) {
|
||||
ok = true;
|
||||
con->setBackgroundMode(true);
|
||||
ecl_fun("app:background-mode-changed", true);
|
||||
} else if (state == Qt::ApplicationActive) {
|
||||
con->setBackgroundMode(false);
|
||||
ecl_fun("app:background-mode-changed", false);
|
||||
if (ok) {
|
||||
con->setBackgroundMode(false);
|
||||
ecl_fun("app:background-mode-changed", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue