GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
gui_settings Class Reference

#include "gui-settings.h"

Inheritance diagram for gui_settings:
Collaboration diagram for gui_settings:

Public Member Functions

 gui_settings (const gui_settings &)=delete
 
 gui_settings (const QString &file_name, QSettings::Format format, QObject *parent=nullptr)
 
 gui_settings (QSettings::Format format, QSettings::Scope scope, const QString &organization, const QString &application=QString(), QObject *parent=nullptr)
 
 ~gui_settings (void)=default
 
QColor color_value (const gui_pref &pref, int mode=0) const
 
QColor get_color_value (const QVariant &def, int mode=0) const
 
gui_settingsoperator= (const gui_settings &)=delete
 
QKeySequence sc_def_value (const sc_pref &pref) const
 
QString sc_value (const sc_pref &pref) const
 
void set_color_value (const gui_pref &pref, const QColor &color, int mode=0)
 
QVariant value (const gui_pref &pref) const
 

Detailed Description

Definition at line 37 of file gui-settings.h.

Constructor & Destructor Documentation

◆ gui_settings() [1/3]

gui_settings::gui_settings ( const QString &  file_name,
QSettings::Format  format,
QObject parent = nullptr 
)
inline

Definition at line 43 of file gui-settings.h.

◆ gui_settings() [2/3]

gui_settings::gui_settings ( QSettings::Format  format,
QSettings::Scope  scope,
const QString &  organization,
const QString &  application = QString (),
QObject parent = nullptr 
)
inline

Definition at line 48 of file gui-settings.h.

◆ gui_settings() [3/3]

gui_settings::gui_settings ( const gui_settings )
delete

◆ ~gui_settings()

gui_settings::~gui_settings ( void  )
default

Member Function Documentation

◆ color_value()

QColor gui_settings::color_value ( const gui_pref pref,
int  mode = 0 
) const

Reading a color from the gui_settings taking possible color modes into account. The default value for a second color mode mode=1 is deterimined from the standard default value mode=0 by inverting the lightness (see get_color_value())

Parameters
prefgui preference (key string, default value); the default value can be given by QColor or QPalette::ColorRole
modeColor mode (currently 0 or 1, default is 0)
Returns
Color as QColor

Definition at line 69 of file gui-settings.cc.

References gui_pref::def, get_color_value(), gui_pref::key, settings_color_modes_ext(), and value().

◆ get_color_value()

QColor gui_settings::get_color_value ( const QVariant &  def,
int  mode = 0 
) const

Reading a color from the given QVaraitn def taking different color modes into account. The default value for a second color mode mode=1 is deterimined from the standard default value mode=0 by inverting the lightness

\begin{eqnarray*} H_1 &=& H_0\\ S_1 &=& S_0\\ L_1 &=& 1.0 - 0.85 L_0 L_0 > 0.3 L_1 &=& 1.0 - 0.70 L_0 L_0 < 0.3 \end{eqnarray*}

Parameters
defColor default value given by a QVariant of QColor or QPalette::ColorRole
modeColor mode (currently 0 or 1, default is 0)
Returns
Color as QColor

Definition at line 37 of file gui-settings.cc.

References settings_color_no_change(), and value().

Referenced by color_value().

◆ operator=()

gui_settings& gui_settings::operator= ( const gui_settings )
delete

◆ sc_def_value()

QKeySequence gui_settings::sc_def_value ( const sc_pref pref) const

Definition at line 96 of file gui-settings.cc.

References sc_pref::def, and sc_pref::def_std.

Referenced by sc_value().

◆ sc_value()

QString gui_settings::sc_value ( const sc_pref pref) const

Definition at line 87 of file gui-settings.cc.

References sc_pref::key, sc_def_value(), sc_group(), and value().

◆ set_color_value()

void gui_settings::set_color_value ( const gui_pref pref,
const QColor &  color,
int  mode = 0 
)

Writing a color to the gui_settings taking possible color modes into account. When mode is not zero (standard mode), the extension related to the mode is appended to the settings key string

Parameters
prefgui preference where the color should be written
colorQColor to write to the settings
modeColor mode (currently 0 or 1, default is 0)

Definition at line 77 of file gui-settings.cc.

References gui_pref::key, m, and settings_color_modes_ext().

◆ value()


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