Version: 6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes

QtxPagePrefEditItem Class Reference

GUI implementation of the resources line edit box item for string, integer and double values.

#include <QtxPagePrefMgr.h>

Inheritance diagram for QtxPagePrefEditItem:
Inheritance graph

Public Types

enum  InputType { String, Integer, Double }

Public Member Functions

 QtxPagePrefEditItem (const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString())
 Constructor.
 QtxPagePrefEditItem (const int, const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString())
 Constructor.
virtual ~QtxPagePrefEditItem ()
 Destructor.
int inputType () const
 Get edit box preference item input type.
void setInputType (const int)
 Set edit box preference item input type.
int decimals () const
 Get number of digits after decimal point (for Double input type)
void setDecimals (const int)
 Set number of digits after decimal point (for Double input type)
int echoMode () const
 Get the line edit's echo mode.
void setEchoMode (const int)
 Set the line edit's echo mode.
virtual void store ()
 Store preference item to the resource manager.
virtual void retrieve ()
 Retrieve preference item from the resource manager.
virtual void setTitle (const QString &)
 Set preference title.
QWidgetwidget () const
 Get preference item editor widget.
virtual void activate ()
void ensureVisible ()
int id () const
 Get unique item identifier.
virtual int rtti () const
 Get unique item type identifier.
QtxPreferenceItemrootItem () const
 Get root preference item.
QtxPreferenceItemparentItem () const
 Get parent preference item.
QList< QtxPreferenceItem * > childItems (const bool=false) const
 Get all child preference items.
int depth () const
 Get preference item depth.
int count () const
 Get child preference items number.
virtual bool isEmpty () const
 Check if the item has children.
void appendItem (QtxPreferenceItem *)
 Append child preference item.
void removeItem (QtxPreferenceItem *)
 Remove child preference item.
void insertItem (QtxPreferenceItem *, QtxPreferenceItem *=0)
 Insert child preference item before specified item. If the before item is 0 then new item is appended.
QIcon icon () const
 Get preference item icon.
QString title () const
 Get preference item title.
void resource (QString &, QString &) const
 Get resource file settings associated to the preference item.
virtual void setIcon (const QIcon &)
 Set prefence item icon.
virtual void setResource (const QString &, const QString &)
 Assign resource file settings to the preference item.
virtual void updateContents ()
 Update preference item.
QVariant option (const QString &) const
 Get preference item option value.
void setOption (const QString &, const QVariant &)
 Set preference item option value.
bool isEvaluateValues () const
void setEvaluateValues (const bool)
QString resourceValue () const
 Get the value of the associated resource file setting.
void setResourceValue (const QString &)
 Get the value of the associated resource file setting.
QtxPreferenceItemfindItem (const int, const bool=false) const
 Find the item by the specified identifier.
QtxPreferenceItemfindItem (const QString &, const bool=false) const
 Find the item by the specified title.
QtxPreferenceItemfindItem (const QString &, const int, const bool=false) const
 Find the item by the specified title and identifier.
virtual QtxResourceMgrresourceMgr () const
 Get the resources manager.
virtual QtxPreferenceMgrpreferenceMgr () const
 Get the parent preferences manager.

Static Public Member Functions

static void adjustLabels (QtxPagePrefItem *)
static int RTTI ()
 Specify unique item class identifier.

Protected Types

typedef QList
< QtxPreferenceItem * > 
ItemList

Protected Member Functions

virtual QVariant optionValue (const QString &) const
 Get preference item option value.
virtual void setOptionValue (const QString &, const QVariant &)
 Set preference item option value.
QLabellabel () const
 Get label widget corresponding to the preference item.
QWidgetcontrol () const
 Get control widget corresponding to the preference item.
void setControl (QWidget *)
 Set control widget corresponding to the preference item.
void setWidget (QWidget *)
 Set preference item editor widget.
virtual void itemAdded (QtxPreferenceItem *)
 Callback function which is called when the child preference item is added.
virtual void itemRemoved (QtxPreferenceItem *)
 Callback function which is called when the child preference item is removed.
virtual void itemChanged (QtxPreferenceItem *)
 Callback function which is called when the child preference item is modified.
void pageChildItems (QList< QtxPagePrefItem * > &, const bool=false) const
 Find all child items of the QtxPagePrefItem type.
virtual void widgetShown ()
 Invoked when preference item widget is shown.
virtual void widgetHided ()
 Invoked when preference item widget is hided.
virtual void ensureVisible (QtxPreferenceItem *)
int getInteger (const int=0) const
 Get integer resources value corresponding to the item.
double getDouble (const double=0.0) const
 Get double resources value corresponding to the item.
bool getBoolean (const bool=false) const
 Get boolean resources value corresponding to the item.
QColor getColor (const QColor &=QColor()) const
 Get color resources value corresponding to the item.
QFont getFont (const QFont &=QFont()) const
 Get font resources value corresponding to the item.
QString getString (const QString &=QString()) const
 Get string resources value corresponding to the item.
void setInteger (const int)
 Set integer resources value corresponding to the item.
void setDouble (const double)
 Set double resources value corresponding to the item.
void setBoolean (const bool)
 Set boolean resources value corresponding to the item.
void setColor (const QColor &)
 Set color resources value corresponding to the item.
void setFont (const QFont &)
 Set font resources value corresponding to the item.
void setString (const QString &)
 Set string resources value corresponding to the item.
void sendItemChanges ()
 Initiate item changing call back operation.
virtual void triggerUpdate ()
 Initiate item updating.

Private Member Functions

void updateEditor ()
 Update edit box widget.

Private Attributes

int myType
int myDecimals
int myEchoMode
QLineEditmyEditor

Member Typedef Documentation

typedef QList<QtxPreferenceItem*> QtxPreferenceItem.ItemList [protected, inherited]

Member Enumeration Documentation

Enumerator:
String 
Integer 
Double 

Constructor & Destructor Documentation

QtxPagePrefEditItem::QtxPagePrefEditItem ( const QString &  title,
QtxPreferenceItem parent = 0,
const QString &  sect = QString(),
const QString &  param = QString() 
)

Creates preference item for string value editing.

Parameters:
titlepreference item title
parentparent preference item
sectresource file section associated with the preference item
paramresource file parameter associated with the preference item

References myEditor, QtxPageNamedPrefItem.setControl(), and updateEditor().

QtxPagePrefEditItem::QtxPagePrefEditItem ( const int  type,
const QString &  title,
QtxPreferenceItem parent = 0,
const QString &  sect = QString(),
const QString &  param = QString() 
)

Creates preference item for editing of the value which type is specified by parameter type.

Parameters:
typepreference item input type (QtxPagePrefEditItem.InputType)
titlepreference item title
parentparent preference item
sectresource file section associated with the preference item
paramresource file parameter associated with the preference item

References myEditor, QtxPageNamedPrefItem.setControl(), and updateEditor().

QtxPagePrefEditItem::~QtxPagePrefEditItem ( ) [virtual]

Member Function Documentation

int QtxPagePrefEditItem::inputType ( ) const
Returns:
preference item input type (QtxPagePrefEditItem.InputType)
See also:
setInputType()

References myType.

void QtxPagePrefEditItem::setInputType ( const int  type)
Parameters:
typenew preference item input type (QtxPagePrefEditItem.InputType)
See also:
inputType()

References myType, and updateEditor().

int QtxPagePrefEditItem::decimals ( ) const
Returns:
preference item decimals value
See also:
setDecimals()

References myDecimals.

void QtxPagePrefEditItem::setDecimals ( const int  dec)
Parameters:
decnew preference item decimals value
See also:
decimals()

References myDecimals, and updateEditor().

int QtxPagePrefEditItem::echoMode ( ) const
Returns:
preference item echo mode value
See also:
setEchoMode()

References myEchoMode.

void QtxPagePrefEditItem::setEchoMode ( const int  echo)
Parameters:
echonew preference item echo mode value
See also:
echoMode()

References myEchoMode, and updateEditor().

void QtxPagePrefEditItem::store ( ) [virtual]
See also:
retrieve()

Reimplemented from QtxPagePrefItem.

References myEditor, and QtxPreferenceItem.setString().

void QtxPagePrefEditItem::retrieve ( ) [virtual]
See also:
store()

Reimplemented from QtxPagePrefItem.

References fixupAndSet(), QtxPreferenceItem.getString(), and myEditor.

QVariant QtxPagePrefEditItem::optionValue ( const QString &  name) const [protected, virtual]
Parameters:
nameoption name
Returns:
property value or null QVariant if option is not set
See also:
setOptionValue()

Reimplemented from QtxPreferenceItem.

References decimals(), echoMode(), and inputType().

void QtxPagePrefEditItem::setOptionValue ( const QString &  name,
const QVariant &  val 
) [protected, virtual]
Parameters:
nameoption name
valnew property value
See also:
optionValue()

Reimplemented from QtxPreferenceItem.

References setDecimals(), setEchoMode(), and setInputType().

void QtxPagePrefEditItem::updateEditor ( ) [private]
void QtxPageNamedPrefItem::setTitle ( const QString &  txt) [virtual, inherited]
Parameters:
txtnew preference title.

Reimplemented from QtxPreferenceItem.

References QtxPreferenceItem.isEmpty(), QtxPageNamedPrefItem.label(), and QtxPreferenceItem.title().

void QtxPageNamedPrefItem::adjustLabels ( QtxPagePrefItem parent) [static, inherited]
QLabel * QtxPageNamedPrefItem::label ( ) const [protected, inherited]
Returns:
label widget

References QtxPageNamedPrefItem.myLabel.

QWidget * QtxPageNamedPrefItem::control ( ) const [protected, inherited]
Returns:
control widget
See also:
setControl()

References QtxPageNamedPrefItem.myControl.

void QtxPageNamedPrefItem::setControl ( QWidget wid) [protected, inherited]
Parameters:
widcontrol widget
See also:
control()

References QtxPageNamedPrefItem.myControl, and QtxPagePrefItem.widget().

QWidget * QtxPagePrefItem::widget ( ) const [inherited]
Returns:
editor widget
See also:
setWidget()

References QtxPagePrefItem.myWidget.

void QtxPagePrefItem::activate ( ) [virtual, inherited]

Reimplemented from QtxPreferenceItem.

References QtxPagePrefItem.widget().

void QtxPagePrefItem::setWidget ( QWidget wid) [protected, inherited]
void QtxPagePrefItem::itemAdded ( QtxPreferenceItem ) [protected, virtual, inherited]
Parameters:
itemchild item being added
See also:
itemRemoved(), itemChanged()

Reimplemented from QtxPreferenceItem.

References QtxPagePrefItem.contentChanged().

void QtxPagePrefItem::itemRemoved ( QtxPreferenceItem ) [protected, virtual, inherited]
Parameters:
itemchild item being removed
See also:
itemAdded(), itemChanged()

Reimplemented from QtxPreferenceItem.

References QtxPagePrefItem.contentChanged().

void QtxPagePrefItem::itemChanged ( QtxPreferenceItem ) [protected, virtual, inherited]
Parameters:
itemchild item being modified
See also:
itemAdded(), itemRemoved()

Reimplemented from QtxPreferenceItem.

References QtxPagePrefItem.contentChanged().

void QtxPagePrefItem::pageChildItems ( QList< QtxPagePrefItem * > &  list,
const bool  rec = false 
) const [protected, inherited]
Parameters:
listused to return list of child items
recif true, perform recursive search

References QtxPreferenceItem.childItems().

void QtxPagePrefItem::widgetShown ( ) [protected, virtual, inherited]
void QtxPagePrefItem::widgetHided ( ) [protected, virtual, inherited]
void QtxPagePrefItem::ensureVisible ( QtxPreferenceItem i) [protected, virtual, inherited]
void QtxPreferenceItem::ensureVisible ( ) [inherited]
int QtxPreferenceItem::id ( ) const [inherited]
Returns:
item ID

References QtxPreferenceItem.myId.

int QtxPreferenceItem::rtti ( ) const [virtual, inherited]
Returns:
item type ID

References QtxPreferenceItem.RTTI().

QtxPreferenceItem * QtxPreferenceItem::rootItem ( ) const [inherited]
Returns:
root item

References QtxPreferenceItem.parentItem().

QtxPreferenceItem * QtxPreferenceItem::parentItem ( ) const [inherited]
Returns:
parent item

References QtxPreferenceItem.myParent.

QList< QtxPreferenceItem * > QtxPreferenceItem::childItems ( const bool  rec = false) const [inherited]
Parameters:
recrecursion boolean flag
Returns:
list of child items

References QtxPreferenceItem.myChildren.

int QtxPreferenceItem::depth ( ) const [inherited]
Returns:
item depth

References QtxPreferenceItem.depth(), and QtxPreferenceItem.parentItem().

int QtxPreferenceItem::count ( ) const [inherited]
Returns:
number of child items
See also:
isEmpty()

References QtxPreferenceItem.myChildren.

bool QtxPreferenceItem::isEmpty ( ) const [virtual, inherited]
Returns:
true if item does not have children
See also:
count()

References QtxPreferenceItem.myChildren.

void QtxPreferenceItem::appendItem ( QtxPreferenceItem item) [inherited]

Removes (if necessary) the item from the previous parent.

Parameters:
itemitem to be added
See also:
removeItem()

References QtxPreferenceItem.insertItem().

void QtxPreferenceItem::removeItem ( QtxPreferenceItem item) [inherited]
Parameters:
itemitem to be removed
See also:
insertItem()

References QtxPreferenceItem.itemRemoved(), QtxPreferenceItem.myChildren, and QtxPreferenceItem.myParent.

void QtxPreferenceItem::insertItem ( QtxPreferenceItem item,
QtxPreferenceItem before = 0 
) [inherited]

Removes (if necessary) the item from the previous parent.

Parameters:
itemitem to be added
beforeitem before which is inserted new
See also:
removeItem()

References QtxPreferenceItem.itemAdded(), QtxPreferenceItem.myChildren, QtxPreferenceItem.myParent, QtxPreferenceItem.parentItem(), and QtxPreferenceItem.removeItem().

QIcon QtxPreferenceItem::icon ( ) const [inherited]
Returns:
item icon
See also:
setIcon()

References QtxPreferenceItem.myIcon.

QString QtxPreferenceItem::title ( ) const [inherited]
Returns:
item title
See also:
setTitle()

References QtxPreferenceItem.myTitle.

void QtxPreferenceItem::resource ( QString &  sec,
QString &  param 
) const [inherited]
Parameters:
secused to return resource file section name
paramused to return resource file parameter name
See also:
setResource()

References QtxPreferenceItem.myParameter, and QtxPreferenceItem.mySection.

void QtxPreferenceItem::setIcon ( const QIcon &  ico) [virtual, inherited]
Parameters:
iconew item icon
See also:
icon()

References QtxPreferenceItem.myIcon, and QtxPreferenceItem.sendItemChanges().

void QtxPreferenceItem::setResource ( const QString &  sec,
const QString &  param 
) [virtual, inherited]
Parameters:
secresource file section name
paramresource file parameter name
See also:
resource()

Reimplemented in QtxPagePrefGroupItem.

References QtxPreferenceItem.myParameter, and QtxPreferenceItem.mySection.

void QtxPreferenceItem::updateContents ( ) [virtual, inherited]
QVariant QtxPreferenceItem::option ( const QString &  name) const [inherited]
Parameters:
nameoption name
Returns:
property value or null QVariant if option is not set
See also:
setOption()

References QtxPreferenceItem.optionValue().

void QtxPreferenceItem::setOption ( const QString &  name,
const QVariant &  val 
) [inherited]
Parameters:
nameoption name
valnew property value
See also:
option()

References QtxPreferenceItem.optionValue(), QtxPreferenceItem.sendItemChanges(), and QtxPreferenceItem.setOptionValue().

bool QtxPreferenceItem::isEvaluateValues ( ) const [inherited]
void QtxPreferenceItem::setEvaluateValues ( const bool  on) [inherited]
QString QtxPreferenceItem::resourceValue ( ) const [inherited]
Returns:
associated resource file setting value
See also:
setResourceValue()

References QtxPreferenceItem.getString().

void QtxPreferenceItem::setResourceValue ( const QString &  val) [inherited]
Parameters:
valnew associated resource file setting value
See also:
resourceValue()

References QtxPreferenceItem.setString().

QtxPreferenceItem * QtxPreferenceItem::findItem ( const int  id,
const bool  rec = false 
) const [inherited]
Parameters:
idchild item ID
recif true recursive search is done
Returns:
child item or 0 if it is not found

References QtxPreferenceItem.findItem(), QtxPreferenceItem.id(), and QtxPreferenceItem.myChildren.

QtxPreferenceItem * QtxPreferenceItem::findItem ( const QString &  title,
const bool  rec = false 
) const [inherited]
Parameters:
titlechild item title
recif true recursive search is done
Returns:
child item or 0 if it is not found

References QtxPreferenceItem.findItem(), QtxPreferenceItem.myChildren, and QtxPreferenceItem.title().

QtxPreferenceItem * QtxPreferenceItem::findItem ( const QString &  title,
const int  id,
const bool  rec = false 
) const [inherited]
Parameters:
titlechild item title
idchild item ID
recif true recursive search is done
Returns:
child item or 0 if it is not found

References QtxPreferenceItem.findItem(), QtxPreferenceItem.id(), QtxPreferenceItem.myChildren, and QtxPreferenceItem.title().

QtxResourceMgr * QtxPreferenceItem::resourceMgr ( ) const [virtual, inherited]
Returns:
resource manager pointer or 0 if it is not defined

Reimplemented in QtxPreferenceMgr.

References QtxPreferenceItem.preferenceMgr(), and QtxPreferenceMgr.resourceMgr().

QtxPreferenceMgr * QtxPreferenceItem::preferenceMgr ( ) const [virtual, inherited]
Returns:
preferences manager or 0 if it is not defined

Reimplemented in QtxPreferenceMgr.

References QtxPreferenceItem.parentItem(), and QtxPreferenceItem.preferenceMgr().

int QtxPreferenceItem::RTTI ( ) [static, inherited]
Returns:
item class ID
int QtxPreferenceItem::getInteger ( const int  val = 0) const [protected, inherited]
Parameters:
valdefault value (returned if there is no such resource)
Returns:
integer value of the associated resource
See also:
setInteger()

References QtxResourceMgr.integerValue(), QtxPreferenceItem.myParameter, QtxPreferenceItem.mySection, and QtxPreferenceItem.resourceMgr().

double QtxPreferenceItem::getDouble ( const double  val = 0.0) const [protected, inherited]
Parameters:
valdefault value (returned if there is no such resource)
Returns:
double value of the associated resource
See also:
setDouble()

References QtxResourceMgr.doubleValue(), QtxPreferenceItem.myParameter, QtxPreferenceItem.mySection, and QtxPreferenceItem.resourceMgr().

bool QtxPreferenceItem::getBoolean ( const bool  val = false) const [protected, inherited]
Parameters:
valdefault value (returned if there is no such resource)
Returns:
boolean value of the associated resource
See also:
setBoolean()

References QtxResourceMgr.booleanValue(), QtxPreferenceItem.myParameter, QtxPreferenceItem.mySection, and QtxPreferenceItem.resourceMgr().

QColor QtxPreferenceItem::getColor ( const QColor &  val = QColor()) const [protected, inherited]
Parameters:
valdefault value (returned if there is no such resource)
Returns:
color value of the associated resource
See also:
setColor()

References QtxResourceMgr.colorValue(), QtxPreferenceItem.myParameter, QtxPreferenceItem.mySection, and QtxPreferenceItem.resourceMgr().

QFont QtxPreferenceItem::getFont ( const QFont &  val = QFont()) const [protected, inherited]
Parameters:
valdefault value (returned if there is no such resource)
Returns:
font value of the associated resource
See also:
setFont()

References QtxResourceMgr.fontValue(), QtxPreferenceItem.myParameter, QtxPreferenceItem.mySection, and QtxPreferenceItem.resourceMgr().

QString QtxPreferenceItem::getString ( const QString &  val = QString()) const [protected, inherited]
Parameters:
valdefault value (returned if there is no such resource)
Returns:
string value of the associated resource
See also:
setString()

References QtxPreferenceItem.isEvaluateValues(), QtxPreferenceItem.myParameter, QtxPreferenceItem.mySection, QtxPreferenceItem.resourceMgr(), and QtxResourceMgr.value().

void QtxPreferenceItem::setInteger ( const int  val) [protected, inherited]
void QtxPreferenceItem::setDouble ( const double  val) [protected, inherited]
void QtxPreferenceItem::setBoolean ( const bool  val) [protected, inherited]
void QtxPreferenceItem::setColor ( const QColor &  val) [protected, inherited]
void QtxPreferenceItem::setFont ( const QFont &  val) [protected, inherited]
void QtxPreferenceItem::setString ( const QString &  val) [protected, inherited]
void QtxPreferenceItem::sendItemChanges ( ) [protected, inherited]
void QtxPreferenceItem::triggerUpdate ( ) [protected, virtual, inherited]

Field Documentation

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS