VGamepad PC
The PC app for the virtual game controller.
Loading...
Searching...
No Matches
SettingsSingleton Class Reference

#include <settings_singleton.hpp>

Inheritance diagram for SettingsSingleton:
[legend]
Collaboration diagram for SettingsSingleton:
[legend]

Public Member Functions

QSettings * qsettings ()
int mouseSensitivity () const
void setMouseSensitivity (int value)
int port () const
void setPort (int value)
ExecutorType executorType () const
void setExecutorType (ExecutorType type)
void loadAll ()
void saveSetting (const QString &key, const QVariant &value)
QVariant loadSetting (const QString &key)
void resetToDefaults ()
QString activeProfileName () const
void setActiveProfileName (const QString &name)
KeymapProfileactiveKeymapProfile ()
QString getProfilesDir () const
QStringList listAvailableProfiles () const
bool createProfile (const QString &profileName)
bool deleteProfile (const QString &profileName)
bool profileExists (const QString &profileName) const
bool loadProfile (const QString &profileName)
bool saveActiveProfile ()

Static Public Member Functions

static SettingsSingletoninstance ()

Static Public Attributes

static constexpr int DEFAULT_MOUSE_SENSITIVITY = 10
static constexpr int MOUSE_SENSITIVITY_MULTIPLIER = 10
static constexpr int DEFAULT_PORT_NUMBER = 0
static constexpr ExecutorType DEFAULT_EXECUTOR_TYPE = ExecutorType::KeyboardMouseExecutor

Private Member Functions

 SettingsSingleton ()
 ~SettingsSingleton () override=default
 SettingsSingleton (const SettingsSingleton &)=delete
SettingsSingletonoperator= (const SettingsSingleton &)=delete
void loadMouseSensitivity ()
void loadPort ()
void loadExecutorType ()

Private Attributes

QSettings settings
int mouse_sensitivity
int port_number
ExecutorType executor_type
QString m_activeProfileName
KeymapProfile m_activeKeymapProfile

Constructor & Destructor Documentation

◆ SettingsSingleton() [1/2]

SettingsSingleton::SettingsSingleton ( )
private

◆ SettingsSingleton() [2/2]

SettingsSingleton::SettingsSingleton ( const SettingsSingleton & )
privatedelete

Member Function Documentation

◆ activeKeymapProfile()

KeymapProfile & SettingsSingleton::activeKeymapProfile ( )

◆ activeProfileName()

QString SettingsSingleton::activeProfileName ( ) const

◆ createProfile()

bool SettingsSingleton::createProfile ( const QString & profileName)

◆ deleteProfile()

bool SettingsSingleton::deleteProfile ( const QString & profileName)

◆ executorType()

ExecutorType SettingsSingleton::executorType ( ) const
inline

◆ getProfilesDir()

QString SettingsSingleton::getProfilesDir ( ) const

◆ instance()

SettingsSingleton & SettingsSingleton::instance ( )
inlinestatic

◆ listAvailableProfiles()

QStringList SettingsSingleton::listAvailableProfiles ( ) const

◆ loadAll()

void SettingsSingleton::loadAll ( )

◆ loadExecutorType()

void SettingsSingleton::loadExecutorType ( )
private

◆ loadMouseSensitivity()

void SettingsSingleton::loadMouseSensitivity ( )
private

◆ loadPort()

void SettingsSingleton::loadPort ( )
private

◆ loadProfile()

bool SettingsSingleton::loadProfile ( const QString & profileName)

◆ loadSetting()

QVariant SettingsSingleton::loadSetting ( const QString & key)

◆ mouseSensitivity()

int SettingsSingleton::mouseSensitivity ( ) const
inline

◆ operator=()

SettingsSingleton & SettingsSingleton::operator= ( const SettingsSingleton & )
privatedelete

◆ port()

int SettingsSingleton::port ( ) const
inline

◆ profileExists()

bool SettingsSingleton::profileExists ( const QString & profileName) const

◆ qsettings()

QSettings * SettingsSingleton::qsettings ( )
inline

◆ resetToDefaults()

void SettingsSingleton::resetToDefaults ( )

◆ saveActiveProfile()

bool SettingsSingleton::saveActiveProfile ( )

◆ saveSetting()

void SettingsSingleton::saveSetting ( const QString & key,
const QVariant & value )

◆ setActiveProfileName()

void SettingsSingleton::setActiveProfileName ( const QString & name)

◆ setExecutorType()

void SettingsSingleton::setExecutorType ( ExecutorType type)

◆ setMouseSensitivity()

void SettingsSingleton::setMouseSensitivity ( int value)

◆ setPort()

void SettingsSingleton::setPort ( int value)

◆ ~SettingsSingleton()

SettingsSingleton::~SettingsSingleton ( )
overrideprivatedefault

Member Data Documentation

◆ DEFAULT_EXECUTOR_TYPE

ExecutorType SettingsSingleton::DEFAULT_EXECUTOR_TYPE = ExecutorType::KeyboardMouseExecutor
staticconstexpr

◆ DEFAULT_MOUSE_SENSITIVITY

int SettingsSingleton::DEFAULT_MOUSE_SENSITIVITY = 10
staticconstexpr

◆ DEFAULT_PORT_NUMBER

int SettingsSingleton::DEFAULT_PORT_NUMBER = 0
staticconstexpr

◆ executor_type

ExecutorType SettingsSingleton::executor_type
private

◆ m_activeKeymapProfile

KeymapProfile SettingsSingleton::m_activeKeymapProfile
private

◆ m_activeProfileName

QString SettingsSingleton::m_activeProfileName
private

◆ mouse_sensitivity

int SettingsSingleton::mouse_sensitivity
private

◆ MOUSE_SENSITIVITY_MULTIPLIER

int SettingsSingleton::MOUSE_SENSITIVITY_MULTIPLIER = 10
staticconstexpr

◆ port_number

int SettingsSingleton::port_number
private

◆ settings

QSettings SettingsSingleton::settings
private

The documentation for this class was generated from the following files: