GUI implementation of the resources selector item (string, integer or double values list). More...
#include <QtxPagePrefMgr.h>
Public Types | |
enum | InputType { NoInput, String, Integer, Double } |
Public Member Functions | |
QtxPagePrefSelectItem (const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString()) | |
Constructor. More... | |
QtxPagePrefSelectItem (const int, const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString()) | |
Constructor. More... | |
virtual | ~QtxPagePrefSelectItem () |
Destructor. More... | |
int | inputType () const |
Get edit box preference item input type. More... | |
void | setInputType (const int) |
Set edit box preference item input type. More... | |
QStringList | strings () const |
Get the list of the values from the selection widget. More... | |
QList< QVariant > | numbers () const |
Get the list of the values identifiers from the selection widget. More... | |
QList< QIcon > | icons () const |
Get the list of the icons associated with the selection widget.items. More... | |
void | setStrings (const QStringList &) |
Set the list of the values to the selection widget. More... | |
void | setNumbers (const QList< QVariant > &) |
Set the list of the values identifiers to the selection widget. More... | |
void | setIcons (const QList< QIcon > &) |
Set the list of the icons to the selection widget items. More... | |
virtual void | store () |
Store preference item to the resource manager. More... | |
virtual void | retrieve () |
Retrieve preference item from the resource manager. More... | |
Public Member Functions inherited from QtxPageNamedPrefItem | |
QtxPageNamedPrefItem (const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString()) | |
Constructor. More... | |
virtual | ~QtxPageNamedPrefItem () |
Destructor. More... | |
virtual void | setTitle (const QString &) |
Set preference title. More... | |
Public Member Functions inherited from QtxPagePrefItem | |
QtxPagePrefItem (const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString()) | |
Constructor. More... | |
virtual | ~QtxPagePrefItem () |
Destructor. More... | |
QWidget * | widget () const |
Get preference item editor widget. More... | |
virtual void | activate () |
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... | |
QtxPreferenceItem * | rootItem () const |
Get root preference item. More... | |
QtxPreferenceItem * | parentItem () 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 | setResource (const QString &, const QString &) |
Assign resource file settings to the preference item. More... | |
virtual void | updateContents () |
Update 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... | |
QtxPreferenceItem * | findItem (const int, const bool=false) const |
Find the item by the specified identifier. More... | |
QtxPreferenceItem * | findItem (const QString &, const bool=false) const |
Find the item by the specified title. More... | |
QtxPreferenceItem * | findItem (const QString &, const int, const bool=false) const |
Find the item by the specified title and identifier. More... | |
virtual QtxResourceMgr * | resourceMgr () const |
Get the resources manager. More... | |
virtual QtxPreferenceMgr * | preferenceMgr () const |
Get the parent preferences manager. More... | |
void | ensureVisible () |
Protected Member Functions | |
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 QtxPageNamedPrefItem | |
QLabel * | label () const |
Get label widget corresponding to the preference item. More... | |
QWidget * | control () const |
Get control widget corresponding to the preference item. More... | |
void | setControl (QWidget *) |
Set control widget corresponding to the preference item. More... | |
Protected Member Functions inherited from QtxPagePrefItem | |
void | setWidget (QWidget *) |
Set preference item editor widget. More... | |
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... | |
void | pageChildItems (QList< QtxPagePrefItem * > &, const bool=false) const |
Find all child items of the QtxPagePrefItem type. More... | |
virtual void | widgetShown () |
Invoked when preference item widget is shown. More... | |
virtual void | widgetHided () |
Invoked when preference item widget is hided. More... | |
virtual void | ensureVisible (QtxPreferenceItem *) |
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... | |
void | sendItemChanges () |
Initiate item changing call back operation. More... | |
virtual void | triggerUpdate () |
Initiate item updating. More... | |
Private Member Functions | |
void | updateSelector () |
Update selector widget. More... | |
void | setStrings (const QVariant &) |
Set the list of the values from the resource manager. More... | |
void | setNumbers (const QVariant &) |
Set the list of the values identifiers from the resource manager. More... | |
void | setIcons (const QVariant &) |
Set the list of the icons from the resource manager. More... | |
Private Attributes | |
int | myType |
QtxComboBox * | mySelector |
Additional Inherited Members | |
Static Public Member Functions inherited from QtxPageNamedPrefItem | |
static void | adjustLabels (QtxPagePrefItem *) |
Protected Types inherited from QtxPreferenceItem | |
typedef QList < QtxPreferenceItem * > | ItemList |
All items in the list (represented as combo box) should be specified by the unique identifier which is stored to the resource file instead of the value itself.
QtxPagePrefSelectItem::QtxPagePrefSelectItem | ( | const QString & | title, |
QtxPreferenceItem * | parent = 0 , |
||
const QString & | sect = QString() , |
||
const QString & | param = QString() |
||
) |
Creates preference item with combo box widget which is not editable (direct value entering is disabled).
title | preference item title |
parent | parent preference item |
sect | resource file section associated with the preference item |
param | resource file parameter associated with the preference item |
References mySelector, QtxPageNamedPrefItem::setControl(), and updateSelector().
QtxPagePrefSelectItem::QtxPagePrefSelectItem | ( | const int | type, |
const QString & | title, | ||
QtxPreferenceItem * | parent = 0 , |
||
const QString & | sect = QString() , |
||
const QString & | param = QString() |
||
) |
Creates preference item with combo box widget which is editable according to the specified input type (integer, double or string values).
type | input type (QtxPagePrefSelectItem::InputType) |
title | preference item title |
parent | parent preference item |
sect | resource file section associated with the preference item |
param | resource file parameter associated with the preference item |
References mySelector, QtxPageNamedPrefItem::setControl(), and updateSelector().
|
virtual |
QList< QIcon > QtxPagePrefSelectItem::icons | ( | ) | const |
int QtxPagePrefSelectItem::inputType | ( | ) | const |
References myType.
QList< QVariant > QtxPagePrefSelectItem::numbers | ( | ) | const |
References QtxComboBox::hasId(), QtxComboBox::id(), and mySelector.
|
protectedvirtual |
name | option name |
Reimplemented from QtxPreferenceItem.
References icons(), inputType(), numbers(), QtxPreferenceItem::optionValue(), and strings().
|
virtual |
Reimplemented from QtxPagePrefItem.
References QtxPreferenceItem::getString(), QtxComboBox::index(), mySelector, and QtxComboBox::setCleared().
Important: call this method after setStrings() or setNumbers()
icns | new list of icons |
References mySelector.
|
private |
var | new icons list |
References setIcons().
void QtxPagePrefSelectItem::setInputType | ( | const int | type | ) |
type | new preference item input type (QtxPagePrefSelectItem::InputType) |
References myType, and updateSelector().
ids | new list of values IDs |
References mySelector, and QtxComboBox::setId().
|
private |
var | new values IDs list |
References setNumbers().
|
protectedvirtual |
name | option name |
val | new property value |
Reimplemented from QtxPreferenceItem.
References setIcons(), setInputType(), setNumbers(), QtxPreferenceItem::setOptionValue(), and setStrings().
void QtxPagePrefSelectItem::setStrings | ( | const QStringList & | lst | ) |
|
private |
var | new values list |
References setStrings().
|
virtual |
Reimplemented from QtxPagePrefItem.
References QtxComboBox::hasId(), QtxComboBox::id(), QtxComboBox::isCleared(), mySelector, QtxPreferenceItem::setInteger(), and QtxPreferenceItem::setString().
QStringList QtxPagePrefSelectItem::strings | ( | ) | const |
|
private |
References Double, inputType(), Integer, mySelector, and NoInput.
|
private |
|
private |