QuasarAppLib
1.0.530.c9fba11
Toggle main menu visibility
settingslistener.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018-2026 QuasarApp.
3
* Distributed under the lgplv3 software license, see the accompanying
4
* Everyone is permitted to copy and distribute verbatim copies
5
* of this license document, but changing it is not allowed.
6
*/
7
8
#include "
isettings.h
"
9
#include "
settingslistener.h
"
10
11
namespace
QuasarAppUtils
{
12
13
SettingsListener::SettingsListener
() {
14
15
auto
settings =
ISettings::instance
();
16
if
(settings) {
17
18
auto
listener = [
this
](QString key, QVariant val){
19
this->
handleSettingsChanged
(key, val);
20
};
21
22
_listenerConnection = QObject::connect(settings,
23
&
ISettings::valueChanged
,
24
listener);
25
}
26
}
27
28
SettingsListener::~SettingsListener
() {
29
QObject::disconnect(_listenerConnection);
30
}
31
32
}
QuasarAppUtils::ISettings::instance
static ISettings * instance()
instance This method returns pointer to current settings object.
Definition
isettings.cpp:43
QuasarAppUtils::ISettings::valueChanged
void valueChanged(QString key, QVariant value)
valueChanged This signal when value of the key settings changed
QuasarAppUtils::SettingsListener::handleSettingsChanged
virtual void handleSettingsChanged(const QString &key, const QVariant &value)=0
handleSettingsChanged This method will be invoked when settings of application has bean changed.
QuasarAppUtils::SettingsListener::SettingsListener
SettingsListener()
Definition
settingslistener.cpp:13
QuasarAppUtils::SettingsListener::~SettingsListener
virtual ~SettingsListener()
Definition
settingslistener.cpp:28
isettings.h
QuasarAppUtils
The QuasarAppUtils namespace contains the base functions for all applications of the QuasarApp group....
Definition
crc32constexper.h:16
settingslistener.h
settingslistener.cpp
Generated by
1.18.0