Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LightApp_Preferences Class Reference

#include <LightApp_Preferences.h>

Inheritance diagram for LightApp_Preferences:
Inheritance graph

Signals

void preferenceChanged (QString &, QString &, QString &)
 
void resetToDefaults ()
 
void restartRequired ()
 

Public Member Functions

 LightApp_Preferences (QtxResourceMgr *, QWidget *=0)
 
virtual ~LightApp_Preferences ()
 
int addPreference (const QString &label, const int pId=-1, const int=Auto, const QString &section=QString(), const QString &param=QString())
 
int addPreference (const QString &modName, const QString &label, const int pId=-1, const int=Auto, const QString &section=QString(), const QString &param=QString())
 
bool hasModule (const QString &) const
 
void activateItem (const QString &) const
 
- Public Member Functions inherited from SUIT_PreferenceMgr
 SUIT_PreferenceMgr (QtxResourceMgr *, QWidget *=0)
 
virtual ~SUIT_PreferenceMgr ()
 
QIcon itemIcon (const int) const
 
void setItemIcon (const int, const QIcon &)
 
QVariant itemProperty (const QString &, const int=-1) const
 
void setItemProperty (const QString &, const QVariant &, const int=-1)
 
int addItem (const QString &, const int pId=-1, const PrefItemType=Auto, const QString &=QString(), const QString &=QString())
 
- Public Member Functions inherited from QtxPagePrefMgr
 QtxPagePrefMgr (QtxResourceMgr *, QWidget *=0)
 Constructor. More...
 
virtual ~QtxPagePrefMgr ()
 Destructor. More...
 
virtual QSize sizeHint () const
 Get recommended size for the widget. More...
 
virtual QSize minimumSizeHint () const
 Get recommended minimum size for the widget. More...
 
virtual void updateContents ()
 Update widget contents. More...
 
- Public Member Functions inherited from QtxPreferenceMgr
 QtxPreferenceMgr (QtxResourceMgr *)
 Constructor. More...
 
virtual ~QtxPreferenceMgr ()
 Destructor. More...
 
virtual QtxResourceMgrresourceMgr () const
 Get the resources manager. More...
 
virtual QtxPreferenceMgrpreferenceMgr () const
 Get the parent preferences manager. More...
 
QVariant option (const int, const QString &) const
 Get preference item option value. More...
 
void setOption (const int, const QString &, const QVariant &)
 Set preference item option value. More...
 
virtual void store ()
 Store all preferences item to the resource manager. More...
 
virtual void retrieve ()
 Retrieve all preference items from the resource manager. More...
 
virtual void update ()
 Update preferences manager. More...
 
virtual void toBackup ()
 Dumps all values to the backup container. More...
 
virtual void fromBackup ()
 Restore all values from the backup container. More...
 
- Public Member Functions inherited from QtxPreferenceItem
 QtxPreferenceItem (QtxPreferenceItem *=0)
 Constructor. More...
 
 QtxPreferenceItem (const QString &, QtxPreferenceItem *)
 Constructor. More...
 
 QtxPreferenceItem (const QString &, const QString &, const QString &, QtxPreferenceItem *)
 Constructor. More...
 
virtual ~QtxPreferenceItem ()
 Destructor. More...
 
int id () const
 Get unique item identifier. More...
 
virtual int rtti () const
 Get unique item type identifier. More...
 
QtxPreferenceItemrootItem () const
 Get root preference item. More...
 
QtxPreferenceItemparentItem () const
 Get parent preference item. More...
 
QList< QtxPreferenceItem * > childItems (const bool=false) const
 Get all child preference items. More...
 
int depth () const
 Get preference item depth. More...
 
int count () const
 Get child preference items number. More...
 
virtual bool isEmpty () const
 Check if the item has children. More...
 
void appendItem (QtxPreferenceItem *)
 Append child preference item. More...
 
void removeItem (QtxPreferenceItem *)
 Remove child preference item. More...
 
void insertItem (QtxPreferenceItem *, QtxPreferenceItem *=0)
 Insert child preference item before specified item. If the before item is 0 then new item is appended. More...
 
QIcon icon () const
 Get preference item icon. More...
 
QString title () const
 Get preference item title. More...
 
void resource (QString &, QString &) const
 Get resource file settings associated to the preference item. More...
 
virtual void setIcon (const QIcon &)
 Set prefence item icon. More...
 
virtual void setTitle (const QString &)
 Set preference item title . More...
 
virtual void setResource (const QString &, const QString &)
 Assign resource file settings to the preference item. More...
 
QVariant option (const QString &) const
 Get preference item option value. More...
 
void setOption (const QString &, const QVariant &)
 Set preference item option value. More...
 
bool isEvaluateValues () const
 Get variables auto-conversion option value. More...
 
void setEvaluateValues (const bool)
 Switch variables auto-conversion option on/off. More...
 
bool isRestartRequired () const
 Get restart needed option value. More...
 
void setRestartRequired (const bool)
 Switch restart needed option on/off. More...
 
QString resourceValue () const
 Get the value of the associated resource file setting. More...
 
void setResourceValue (const QString &)
 Get the value of the associated resource file setting. More...
 
QtxPreferenceItemfindItem (const int, const bool=false) const
 Find the item by the specified identifier. More...
 
QtxPreferenceItemfindItem (const QString &, const bool=false) const
 Find the item by the specified title. More...
 
QtxPreferenceItemfindItem (const QString &, const int, const bool=false) const
 Find the item by the specified title and identifier. More...
 
virtual void activate ()
 
void ensureVisible ()
 

Protected Member Functions

void changedResources (const ResourceMap &)
 
- Protected Member Functions inherited from SUIT_PreferenceMgr
virtual QVariant optionValue (const QString &) const
 Get preference item option value. More...
 
virtual void setOptionValue (const QString &, const QVariant &)
 Set preference item option value. More...
 
- Protected Member Functions inherited from QtxPagePrefMgr
virtual void itemAdded (QtxPreferenceItem *)
 Callback function which is called when the child preference item is added. More...
 
virtual void itemRemoved (QtxPreferenceItem *)
 Callback function which is called when the child preference item is removed. More...
 
virtual void itemChanged (QtxPreferenceItem *)
 Callback function which is called when the child preference item is modified. More...
 
- Protected Member Functions inherited from QtxPreferenceMgr
void resourceValues (QMap< int, QString > &) const
 Get all resources items values. More...
 
void resourceValues (ResourceMap &) const
 Get all resources items values. More...
 
void setResourceValues (QMap< int, QString > &) const
 Set all resources items values. More...
 
void setResourceValues (ResourceMap &) const
 Set all resources items values. More...
 
void differentValues (const QMap< int, QString > &, const QMap< int, QString > &, QMap< int, QString > &, const bool fromFirst=false) const
 Compare two maps of resources values to find differences. More...
 
void differentValues (const ResourceMap &, const ResourceMap &, ResourceMap &, const bool fromFirst=false) const
 Compare two maps of resources values to find differences. More...
 
- Protected Member Functions inherited from QtxPreferenceItem
int getInteger (const int=0) const
 Get integer resources value corresponding to the item. More...
 
double getDouble (const double=0.0) const
 Get double resources value corresponding to the item. More...
 
bool getBoolean (const bool=false) const
 Get boolean resources value corresponding to the item. More...
 
QColor getColor (const QColor &=QColor()) const
 Get color resources value corresponding to the item. More...
 
QFont getFont (const QFont &=QFont()) const
 Get font resources value corresponding to the item. More...
 
QString getString (const QString &=QString()) const
 Get string resources value corresponding to the item. More...
 
void setInteger (const int)
 Set integer resources value corresponding to the item. More...
 
void setDouble (const double)
 Set double resources value corresponding to the item. More...
 
void setBoolean (const bool)
 Set boolean resources value corresponding to the item. More...
 
void setColor (const QColor &)
 Set color resources value corresponding to the item. More...
 
void setFont (const QFont &)
 Set font resources value corresponding to the item. More...
 
void setString (const QString &)
 Set string resources value corresponding to the item. More...
 
virtual void ensureVisible (QtxPreferenceItem *)
 
void sendItemChanges ()
 Initiate item changing call back operation. More...
 
virtual void triggerUpdate ()
 Initiate item updating. More...
 

Private Types

typedef QMap< int, QString > PrefModuleMap
 

Private Slots

void onHelp ()
 
void onApply ()
 

Private Member Functions

QString module (const int) const
 

Private Attributes

PrefModuleMap myPrefMod
 

Additional Inherited Members

- Public Types inherited from SUIT_PreferenceMgr
enum  PrefItemType {
  Auto, Space, Bool, Color,
  String, Selector, DblSpin, IntSpin,
  Double, Integer, GroupBox, Tab,
  Frame, Font, DirList, File,
  Slider, Shortcut, ShortcutTree, BiColor,
  Background, UserDefined = 1000
}
 
- Public Slots inherited from QtxPagePrefMgr
virtual void setVisible (bool)
 Customize show/hide widget operation. More...
 
- Static Public Member Functions inherited from QtxPreferenceItem
static int RTTI ()
 Specify unique item class identifier. More...
 
- Protected Types inherited from QtxPreferenceMgr
typedef QMap
< QtxPreferenceItem *, QString > 
ResourceMap
 

Detailed Description

Custom preference container. Assign each preference category with module. Emits signal on preference changing

Member Typedef Documentation

typedef QMap<int, QString> LightApp_Preferences::PrefModuleMap
private

Constructor & Destructor Documentation

LightApp_Preferences::LightApp_Preferences ( QtxResourceMgr resMgr,
QWidget parent = 0 
)

Constructor.Initialize by resource manager and parent QWidget.

LightApp_Preferences::~LightApp_Preferences ( )
virtual

Destructor.

Member Function Documentation

void LightApp_Preferences::activateItem ( const QString &  mod) const
int LightApp_Preferences::addPreference ( const QString &  label,
const int  pId = -1,
const int  type = Auto,
const QString &  section = QString(),
const QString &  param = QString() 
)

Adds preference.

References SUIT_PreferenceMgr::addItem().

int LightApp_Preferences::addPreference ( const QString &  mod,
const QString &  label,
const int  pId = -1,
const int  type = Auto,
const QString &  section = QString(),
const QString &  param = QString() 
)
void LightApp_Preferences::changedResources ( const ResourceMap map)
protectedvirtual

Emit preference changed.

Reimplemented from QtxPreferenceMgr.

References module(), preferenceChanged(), and restartRequired().

bool LightApp_Preferences::hasModule ( const QString &  mod) const

Checks: is preferences has module with name mod.

References myPrefMod.

QString LightApp_Preferences::module ( const int  id) const
private

Gets module name by id, if exist.

References myPrefMod.

void LightApp_Preferences::onApply ( )
privateslot

Store preferences on apply.

References QtxPreferenceMgr::store().

void LightApp_Preferences::onHelp ( )
privateslot

Do nothing.

void LightApp_Preferences::preferenceChanged ( QString &  ,
QString &  ,
QString &   
)
signal
void LightApp_Preferences::resetToDefaults ( )
signal
void LightApp_Preferences::restartRequired ( )
signal

Member Data Documentation

PrefModuleMap LightApp_Preferences::myPrefMod
private

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