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

List showing the setting groups. More...

#include <settingstopview.h>

Collaboration diagram for Updraft::Core::SettingsTopView:

List of all members.

Public Slots

bool setShowAdvanced (bool show)
 Shows/hides the advanced setting groups.

Public Member Functions

 SettingsTopView (QWidget *parent=0)
void setBottom (SettingsBottomView *b)
 Sets the internal pointer to the bottom view.
void setModel (QAbstractItemModel *model)
 Sets the data model used by this view.

Protected Slots

void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 Handles change of data in some items.
void rowsInserted (const QModelIndex &parent, int start, int end)
 Handles row insertion into the model.
void currentChanged (const QModelIndex &current, const QModelIndex &previous)
 Handles change of the currently selected item.

Private Member Functions

bool groupIsAdvanced (int row)
 Tells whether the group is a group with advanced settings.
bool groupShouldBeHidden (int row)
 Says whether the group is hidden or empty and should thus not show.
void hideGroup (int row)
 Hides the settings group in the given row.
void displayGroup (int row)
 Displays the settings grou in the given row.

Private Attributes

QRegExp advancedGroupRegExp
 Regular expression that determines whether the group is an advanced group.
QRegExp hiddenGroupRegExp
 Regular expression that determines whether the group is a hidden group.
bool showAdvanced
 Whether the advanced groups should be shown.
SettingsBottomViewbottom
 Pointer to the bottom view.
bool groupChangeInProgress
 Helper flag that prevents re-entry in the currentChanged() method.

Detailed Description

List showing the setting groups.

It shows just the first item from the top-level rows of the data model. These items describe, according to our convention, the setting groups.


Constructor & Destructor Documentation

Updraft::Core::SettingsTopView::SettingsTopView ( QWidget *  parent = 0) [explicit]

Member Function Documentation

void Updraft::Core::SettingsTopView::currentChanged ( const QModelIndex &  current,
const QModelIndex &  previous 
) [protected, slot]

Handles change of the currently selected item.

Updates the displayed data. This slot should be connected to the corresponding signal in the model.

Parameters:
currentThe new currently selected index.
previousThe previously selected index.
void Updraft::Core::SettingsTopView::dataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
) [protected, slot]

Handles change of data in some items.

Updates the displayed data. This slot should be connected to the corresponding signal in the model. Note that this view does not support multiple data items changed in one signal, so topLeft should always equal to bottomRight.

Parameters:
topLeftIndex of the top-left item from the set that changed.
bottomRightIndex of the bottom-rigt item from the set that changed.
void Updraft::Core::SettingsTopView::displayGroup ( int  row) [private]

Displays the settings grou in the given row.

If the group does not contain any settings, it stays hidden.

Parameters:
rowThe row number of the group.

Tells whether the group is a group with advanced settings.

Parameters:
rowThe row number of the group.
Returns:
Whether the group is an advanced group.

Says whether the group is hidden or empty and should thus not show.

Parameters:
rowThe row number of the group.
Returns:
Whether the group is a hidden group or an empty group. Both cases mean that it should not be displayed in the dialog.
void Updraft::Core::SettingsTopView::hideGroup ( int  row) [private]

Hides the settings group in the given row.

Parameters:
rowThe row number of the group.
void Updraft::Core::SettingsTopView::rowsInserted ( const QModelIndex &  parent,
int  start,
int  end 
) [protected, slot]

Handles row insertion into the model.

Updates the displayed data. This slot should be connected to the corresponding signal in the model.

Parameters:
parentIndex of the item under which the rows were inserted.
startThe first row that was inserted.
endIndex one-after the last inserted row.

Sets the internal pointer to the bottom view.

Parameters:
bThe bottom view of the parent dialog.
void Updraft::Core::SettingsTopView::setModel ( QAbstractItemModel *  model)

Sets the data model used by this view.

Parameters:
modelThe model used for retrieving the setting group data.

Shows/hides the advanced setting groups.

Parameters:
showWhether to show the advanced setting groups.

Member Data Documentation

Regular expression that determines whether the group is an advanced group.

Pointer to the bottom view.

Helper flag that prevents re-entry in the currentChanged() method.

Regular expression that determines whether the group is a hidden group.

Whether the advanced groups should be shown.


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