Updraft
1.0
Open source glider flight visualisation tool.
|
List showing the setting groups. More...
#include <settingstopview.h>
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 ¤t, 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. | |
SettingsBottomView * | bottom |
Pointer to the bottom view. | |
bool | groupChangeInProgress |
Helper flag that prevents re-entry in the currentChanged() method. |
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.
Updraft::Core::SettingsTopView::SettingsTopView | ( | QWidget * | parent = 0 | ) | [explicit] |
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.
current | The new currently selected index. |
previous | The 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.
topLeft | Index of the top-left item from the set that changed. |
bottomRight | Index 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.
row | The row number of the group. |
bool Updraft::Core::SettingsTopView::groupIsAdvanced | ( | int | row | ) | [private] |
Tells whether the group is a group with advanced settings.
row | The row number of the group. |
bool Updraft::Core::SettingsTopView::groupShouldBeHidden | ( | int | row | ) | [private] |
Says whether the group is hidden or empty and should thus not show.
row | The row number of the group. |
void Updraft::Core::SettingsTopView::hideGroup | ( | int | row | ) | [private] |
Hides the settings group in the given row.
row | The 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.
parent | Index of the item under which the rows were inserted. |
start | The first row that was inserted. |
end | Index one-after the last inserted row. |
void Updraft::Core::SettingsTopView::setBottom | ( | SettingsBottomView * | b | ) | [inline] |
Sets the internal pointer to the bottom view.
b | The bottom view of the parent dialog. |
void Updraft::Core::SettingsTopView::setModel | ( | QAbstractItemModel * | model | ) |
Sets the data model used by this view.
model | The model used for retrieving the setting group data. |
bool Updraft::Core::SettingsTopView::setShowAdvanced | ( | bool | show | ) | [slot] |
Shows/hides the advanced setting groups.
show | Whether to show the advanced setting groups. |
QRegExp Updraft::Core::SettingsTopView::advancedGroupRegExp [private] |
Regular expression that determines whether the group is an advanced group.
Pointer to the bottom view.
bool Updraft::Core::SettingsTopView::groupChangeInProgress [private] |
Helper flag that prevents re-entry in the currentChanged() method.
QRegExp Updraft::Core::SettingsTopView::hiddenGroupRegExp [private] |
Regular expression that determines whether the group is a hidden group.
bool Updraft::Core::SettingsTopView::showAdvanced [private] |
Whether the advanced groups should be shown.