Falkon Develop
Cross-platform Qt-based web browser
QmlSettings Class Reference

The class exposing Settings API to QML. More...

#include <qmlsettings.h>

Inheritance diagram for QmlSettings:

Public Member Functions

 QmlSettings (QObject *parent=nullptr)
 
Q_INVOKABLE bool setValue (const QVariantMap &map)
 Sets the value for a given key. More...
 
Q_INVOKABLE QVariant value (const QVariantMap &map)
 Gets the value for a given key. More...
 
Q_INVOKABLE bool contains (const QString &key)
 Checks if a given key exists. More...
 
Q_INVOKABLE bool remove (const QString &key)
 Removes the given key-value from the settings. More...
 
Q_INVOKABLE bool sync ()
 syncs the settings More...
 

Properties

QString name
 name of the folder in which settings.ini file is located on the standard extension path. More...
 

Detailed Description

The class exposing Settings API to QML.

Definition at line 26 of file qmlsettings.h.

Constructor & Destructor Documentation

◆ QmlSettings()

QmlSettings::QmlSettings ( QObject *  parent = nullptr)
explicit

Definition at line 22 of file qmlsettings.cpp.

Member Function Documentation

◆ contains()

bool QmlSettings::contains ( const QString &  key)

Checks if a given key exists.

Parameters
QStringrepresenting the key
Returns
true if key exists, else false

Definition at line 60 of file qmlsettings.cpp.

◆ remove()

bool QmlSettings::remove ( const QString &  key)

Removes the given key-value from the settings.

Parameters
QStringrepresenting the key
Returns
true if key-value pair is removed, else false

Definition at line 69 of file qmlsettings.cpp.

◆ setValue()

bool QmlSettings::setValue ( const QVariantMap &  map)

Sets the value for a given key.

Parameters
AJavaScript object containing
  • key: QString representing the key
  • value: QVariant representing the value for the key
Returns
true if value is set, else false

Definition at line 28 of file qmlsettings.cpp.

◆ sync()

bool QmlSettings::sync ( )

syncs the settings

Returns
true if success, else false

Definition at line 79 of file qmlsettings.cpp.

◆ value()

QVariant QmlSettings::value ( const QVariantMap &  map)

Gets the value for a given key.

Parameters
AJavaScript object containing
  • key: QString representing the key
  • defaultValue: QVariant representing the default value for the key
Returns
QVariant representing value

Definition at line 44 of file qmlsettings.cpp.

Property Documentation

◆ name

QString QmlSettings::name
readwrite

name of the folder in which settings.ini file is located on the standard extension path.

Definition at line 1 of file qmlsettings.h.


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