VGamepad PC
The Windows 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)
 
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 = 100
 
static constexpr int DEFAULT_PORT_NUMBER = 0
 

Private Member Functions

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

Private Attributes

QSettings settings
 
int mouse_sensitivity
 
int port_number
 
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)

◆ getProfilesDir()

QString SettingsSingleton::getProfilesDir ( ) const

◆ instance()

static SettingsSingleton & SettingsSingleton::instance ( )
inlinestatic

◆ listAvailableProfiles()

QStringList SettingsSingleton::listAvailableProfiles ( ) const

◆ loadAll()

void SettingsSingleton::loadAll ( )

◆ 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)

◆ setMouseSensitivity()

void SettingsSingleton::setMouseSensitivity ( int value)

◆ setPort()

void SettingsSingleton::setPort ( int value)

◆ ~SettingsSingleton()

SettingsSingleton::~SettingsSingleton ( )
overrideprivatedefault

Member Data Documentation

◆ DEFAULT_MOUSE_SENSITIVITY

int SettingsSingleton::DEFAULT_MOUSE_SENSITIVITY = 10
staticconstexpr

◆ DEFAULT_PORT_NUMBER

int SettingsSingleton::DEFAULT_PORT_NUMBER = 0
staticconstexpr

◆ 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 = 100
staticconstexpr

◆ port_number

int SettingsSingleton::port_number
private

◆ settings

QSettings SettingsSingleton::settings
private

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