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

#include "gui-settings.h"

Inheritance diagram for octave::gui_settings:
Collaboration diagram for octave::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 35 of file gui-settings.h.

Constructor & Destructor Documentation

◆ gui_settings() [1/3]

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

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

◆ gui_settings() [2/3]

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

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

◆ gui_settings() [3/3]

octave::gui_settings::gui_settings ( const gui_settings )
delete

◆ ~gui_settings()

octave::gui_settings::~gui_settings ( void  )
default

Member Function Documentation

◆ color_value()

QColor octave::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 70 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 octave::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 38 of file gui-settings.cc.

References settings_color_no_change().

Referenced by color_value().

◆ operator=()

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

◆ sc_def_value()

QKeySequence octave::gui_settings::sc_def_value ( const sc_pref pref) const

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

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

Referenced by sc_value().

◆ sc_value()

QString octave::gui_settings::sc_value ( const sc_pref pref) const

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

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

◆ set_color_value()

void octave::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 78 of file gui-settings.cc.

References gui_pref::key, and settings_color_modes_ext().

◆ value()


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