Storyboard
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 (String name, ColorRGBA defaultValue)
 get the color from the given preference name
 
void setColor (String name, ColorRGBA color)
 set the color for the given preference name
 
double getDouble (String name, double defaultValue)
 get the double value from the given preference name
 
void setDouble (String name, double value)
 set the double value for the given preference name
 
double getInt (String name, int defaultValue)
 get the integer value from the given preference name
 
void setInt (String name, int value)
 set the integer value for the given preference name
 
bool getBool (String name, bool defaultValue)
 get the boolean value from the given preference name
 
void setBool (String name, bool value)
 get the boolean value for the given preference name
 
String getString (String name, String defaultValue)
 get the string value from the given preference name
 
void setString (String name, String value)
 set the string value for the given preference name
 
double getEnumValue (String name, int defaultValue)
 
void setEnumValue (String name, int value)
 

Public Member Functions

 preferences (QObject *parent, 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.

You can use it in Script Editor only.

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,
char *  name 
)

Member Function Documentation

bool preferences::getBool ( String  name,
bool  defaultValue 
)
slot

get the boolean value from the given preference name

ColorRGBA preferences::getColor ( String  name,
ColorRGBA  defaultValue 
)
slot

get the color from the given preference name

double preferences::getDouble ( String  name,
double  defaultValue 
)
slot

get the double value from the given preference name

double preferences::getEnumValue ( String  name,
int  defaultValue 
)
slot
double preferences::getInt ( String  name,
int  defaultValue 
)
slot

get the integer value from the given preference name

String preferences::getString ( String  name,
String  defaultValue 
)
slot

get the string value from the given preference name

void preferences::setBool ( String  name,
bool  value 
)
slot

get the boolean value for the given preference name

void preferences::setColor ( String  name,
ColorRGBA  color 
)
slot

set the color for the given preference name

void preferences::setDouble ( String  name,
double  value 
)
slot

set the double value for the given preference name

void preferences::setEnumValue ( String  name,
int  value 
)
slot
void preferences::setInt ( String  name,
int  value 
)
slot

set the integer value for the given preference name

void preferences::setString ( String  name,
String  value 
)
slot

set the string value for the given preference name


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