OMC::Preferences Class Reference

Detailed Description

The user preferences for the application.

The preference handler for the application provides read and write access to the current application preferences. This is useful for storing and modifying tool preferences.

from ToonBoom import harmony #Import the Harmony Module
sess = harmony.session() #Get access to the Harmony session, this class.
prefs = sess.preferences #Get preferences handler.
prefs["PEG_DEFAULT_SEPARATE_POSITION"] = True #Expectation: The Peg default separate position preference will now be set to true.

Public Member Functions

OMC::PreferencePairoperator[QString &name] ()
 Get and set a preference by name. More...
 
virtual std::map< QString, QVariant > list () const override
 Convert the dynamic list into a static list of preference items.
 
virtual QVariant value (const QString &key, const QVariant &defaultValue)
 Get a preference value with a default value as a fallback if that key doesn't exist.
 
virtual void replace (const QString &, const QVariant &item)
 Replace a preference at the given key with a value – an error will occur if the preference types don't match.
 
virtual QString type (const QString &)
 Identify the type of preference at the given key.
 
virtual bool reset (const QString &)
 Reset the preference to its default value.
 

Member Function Documentation

◆ operator[QString &name]()

OMC::PreferencePair* OMC::Preferences::operator[QString &name] ( )

Get and set a preference by name.

Inheritance diagram for OMC::Preferences:
Collaboration diagram for OMC::Preferences: