Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Core::SettingsItem Class Reference

A single setting. More...

#include <settingsmodel.h>

Collaboration diagram for Updraft::Core::SettingsItem:

List of all members.

Public Member Functions

 SettingsItem (QDomNode node, SettingsModel *model)
 Creates the settings item to contain the given QDomNode, belonging to the given SettingsModel.
 ~SettingsItem ()
void prependChild (SettingsItem *item)
 Adds a child SettingsItem before all children in this SettingsItem.
void appendChild (SettingsItem *item)
 Adds a child SettingsItem after all children in this SettingsItem.
void insertChild (SettingsItem *item, int index)
 Adds a child SettingsItem into the given position in the children list of this item.
SettingsItemgetChild (int index)
 Gets the child SettingsItem at the given index.
int childIndex (SettingsItem *item)
 Returns the index of a child SettingsItem in this SettingsItem.
SettingsItemgetParent ()
QDomNode getNode ()
int rowCount ()
SettingsModelgetModel ()
void setIcon (QIcon i)
 Sets the icon for this settings item.
QIcon getIcon ()

Private Attributes

QDomNode domNode
 The QDomNode pointing to the data of this setting.
QVector< SettingsItem * > children
 Children of this SettingsItem SettingsModel hierarchy.
SettingsItemparent
 Parent of this SettingsItem in the SettingsModel hierarchy.
SettingsModelmyModel
 The SettingsModel where the data for this item is stored.
QIcon icon
 Icon used by this item.

Detailed Description

A single setting.

It contains a QDomNode that points to the item in the QDomDocument hierarchy that contains the setting's data.


Constructor & Destructor Documentation

Updraft::Core::SettingsItem::SettingsItem ( QDomNode  node,
SettingsModel model 
)

Creates the settings item to contain the given QDomNode, belonging to the given SettingsModel.

Parameters:
nodeThe QDomNode that this SettingsItem should contain.
modelThe data model to which this setting belongs.

Member Function Documentation

Adds a child SettingsItem after all children in this SettingsItem.

Parameters:
itemThe item to append as a child of this item.

Returns the index of a child SettingsItem in this SettingsItem.

Parameters:
itemThe child whose index is to be retrieved.
Returns:
Index of the child item.

Gets the child SettingsItem at the given index.

Returns:
The desired child item.
Returns:
The currently used icon for the item. Can be an empty icon if no icon was set for this item.
Returns:
The SettingsModel for this item.
QDomNode Updraft::Core::SettingsItem::getNode ( ) [inline]
Returns:
A copy of the QDomNode that points to the setting data in the SettingsModel.
Returns:
The parent item of this SettingsItem. Can be NULL if this item has no parent.
void Updraft::Core::SettingsItem::insertChild ( SettingsItem item,
int  index 
)

Adds a child SettingsItem into the given position in the children list of this item.

Parameters:
itemThe item to insert as a child of this item.
indexThe index at which the item should be inserted.

Adds a child SettingsItem before all children in this SettingsItem.

Parameters:
itemThe item to prepend as a child of this item.
Returns:
Number of rows in this item - i.e. the number of child items.
void Updraft::Core::SettingsItem::setIcon ( QIcon  i) [inline]

Sets the icon for this settings item.

Used for setting group icons.

Parameters:
iThe new icon for the item.

Member Data Documentation

Children of this SettingsItem SettingsModel hierarchy.

The QDomNode pointing to the data of this setting.

Icon used by this item.

The SettingsModel where the data for this item is stored.

Parent of this SettingsItem in the SettingsModel hierarchy.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines