Script
Public Slots | Public Member Functions | List of all members
preferences Class Reference

With the Preferences functions, you can retrieve information about the whole preference system. The user can set and retrieve the value of any preferences in the software. More...

#include <prefinterface.h>

Inheritance diagram for preferences:
Inheritance graph
[legend]
Collaboration diagram for preferences:
Collaboration graph
[legend]

Public Slots

ColorRGBA getColor (QString name, ColorRGBA defaultValue) const
 
void setColor (QString name, ColorRGBA color)
 
double getDouble (QString name, double defaultValue)
 
void setDouble (QString name, double value)
 
double getInt (QString name, int defaultValue)
 
void setInt (QString name, int value)
 
bool getBool (QString name, bool defaultValue)
 
void setBool (QString name, bool value)
 
QString getString (QString name, QString defaultValue)
 
void setString (QString name, QString value)
 
double getEnumValue (QString name, int defaultValue)
 
void setEnumValue (QString name, int value)
 

Public Member Functions

 preferences (QObject *parent, const char *name)
 

Detailed Description

With the Preferences functions, you can retrieve information about the whole preference system. The user can set and retrieve the value of any preferences in the software.

The actual name and current value of a preference are in stored in the user configuration file.

The file prefs.xml contains a description of all preferences recognized by the application. The keyword to access each predefined preference is also found in that file.

Scripts can change or retrieve any existing preference, and may create new preferences.

function toggleAutoSaveLayout()
{
var b;
b = preferences.getBool( "AUTO_SAVE_LAYOUT", false );
print( "preference to automatically save the layout was " + b );
preferences.setBool( "AUTO_SAVE_LAYOUT", !b );
b = preferences.getBool( "AUTO_SAVE_LAYOUT", false );
print( "preference for auto save layout is now " + b );
}

Constructor & Destructor Documentation

preferences::preferences ( QObject *  parent,
const char *  name 
)

Member Function Documentation

bool preferences::getBool ( QString  name,
bool  defaultValue 
)
slot
ColorRGBA preferences::getColor ( QString  name,
ColorRGBA  defaultValue 
) const
slot
double preferences::getDouble ( QString  name,
double  defaultValue 
)
slot
double preferences::getEnumValue ( QString  name,
int  defaultValue 
)
slot
double preferences::getInt ( QString  name,
int  defaultValue 
)
slot
QString preferences::getString ( QString  name,
QString  defaultValue 
)
slot
void preferences::setBool ( QString  name,
bool  value 
)
slot
void preferences::setColor ( QString  name,
ColorRGBA  color 
)
slot
void preferences::setDouble ( QString  name,
double  value 
)
slot
void preferences::setEnumValue ( QString  name,
int  value 
)
slot
void preferences::setInt ( QString  name,
int  value 
)
slot
void preferences::setString ( QString  name,
QString  value 
)
slot

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