gio-qt 0.0.16
Loading...
Searching...
No Matches
DGioSettings Class Reference

Access GSettings in a more Qt way. More...

Inheritance diagram for DGioSettings:
Collaboration diagram for DGioSettings:

Signals

void valueChanged (const QString &key, const QVariant &value)

Public Member Functions

 DGioSettings (const QString &schemaId, QObject *parent=nullptr)
 Create a DGioSettings object for a given schemaId.
 DGioSettings (const QString &schemaId, const QString &path, QObject *parent=nullptr)
 Create a DGioSettings object for a given schemaId and path.
void sync ()
bool setValue (const QString &key, const QVariant &value, bool sync=false)
 Sets the value at key to value.
QVariant value (const QString &key) const
Q_DECL_DEPRECATED QStringList keys () const
 Retrieves the list of avaliable keys.
void reset (const QString &key)

Static Public Member Functions

static bool isSchemaInstalled (const QString &schemaId)

Detailed Description

Access GSettings in a more Qt way.

This is not a directly wrapper of Gio::Settings class, so interfaces are not matched to the giomm ome.

Constructor & Destructor Documentation

◆ DGioSettings() [1/2]

DGioSettings::DGioSettings ( const QString & schemaId,
QObject * parent = nullptr )
explicit

Create a DGioSettings object for a given schemaId.

In case you would like to skip path but provide a parent.

Warning: not existed schemaId will cause the program crashed.

◆ DGioSettings() [2/2]

DGioSettings::DGioSettings ( const QString & schemaId,
const QString & path,
QObject * parent = nullptr )

Create a DGioSettings object for a given schemaId and path.

Warning: not existed schemaId will cause the program crashed.

Member Function Documentation

◆ keys()

QStringList DGioSettings::keys ( ) const

Retrieves the list of avaliable keys.

According to g_settings_list_keys() document: You should probably not be calling this function from "normal" code (since you should already know what keys are in your schema). This function is intended for introspection reasons.

Thus we also mark this function as DEPRECATED just like what glib does.

◆ setValue()

bool DGioSettings::setValue ( const QString & key,
const QVariant & value,
bool sync = false )

Sets the value at key to value.

Not all values that a QVariant can hold can be serialized into a setting. Basic types are supported. the provided variant value will be converted according to the original GSetting value type.

List of supported types:

  • boolean
  • byte/char
  • int, uint, long long
  • double
  • string
  • string list.
Parameters
synccall sync() after value applied if success.
Returns
true if success, false if failed.

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