Updraft
1.0
Open source glider flight visualisation tool.
|
List showing the individual setting items within one group. More...
#include <settingsbottomview.h>
Public Slots | |
void | commit () |
Commits the data from editors into the model. | |
void | reset () |
Resets the values in the editors to the values that are in the model. | |
Signals | |
void | restartInfo (bool needsRestart) |
Signals whether there is a setting in the currently displayed page that needs the application to restart on its value change. | |
Public Member Functions | |
SettingsBottomView (QWidget *parent) | |
~SettingsBottomView () | |
QModelIndex | indexAt (const QPoint &point) const |
Gets the index of the item at the given point. | |
void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) |
Scrolls to the given model index. | |
QRect | visualRect (const QModelIndex &index) const |
The visual rectangle that encapsulates the given model index. | |
bool | editorValuesChanged () |
Tells whether there are any changes on the current page. | |
void | setModel (QAbstractItemModel *model) |
Sets the data model used by this view. | |
void | setTopIndex (const QModelIndex &index) |
Reacts to the top view selected group index change. | |
void | setItemDelegate (QAbstractItemDelegate *delegate) |
Sets the item delegate used by this view. | |
Protected Slots | |
void | commitData (QWidget *editor) |
Commits the data of the given editor. | |
void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight) |
Reacts to the change of the data of a (set of) setting(s). | |
void | rowsInserted (const QModelIndex &parent, int start, int end) |
Reacts to a row insertion on the underlying model. | |
Protected Member Functions | |
void | createEditors () |
Creates all the setting labels and editors. | |
QWidget * | createEditorForIndex (const QModelIndex &index) |
Helper method that creates an editor for the item at a given index. | |
void | paintEvent (QPaintEvent *event) |
Reacts to the Qt repaint event. | |
void | resizeEvent (QResizeEvent *event) |
Reacts to the Qt resize event. | |
int | horizontalOffset () const |
Currently unimplemented, but defined to be able to instantiate objects. | |
bool | isIndexHidden (const QModelIndex &index) const |
Currently unimplemented, but defined to be able to instantiate objects. | |
QString | getSettingDescription (const QModelIndex &settingIndex) const |
Returns the description of the setting at the given index. | |
bool | settingNeedsRestart (const QModelIndex &settingIndex) const |
Returns whether the given setting requires the application to restart if its value changes. | |
QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) |
Reacts to the cursor movement over the view. | |
void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags flags) |
Sets the selection in this view. | |
int | verticalOffset () const |
Gets vertical offset between the individual items. | |
QRegion | visualRegionForSelection (const QItemSelection &selection) const |
Returns a visual region corresponding to the given set of selected items. | |
bool | someSettingNeedsRestart () |
Finds out whether there is a setting in the currently displayed group that needs the application to restart on its value change. | |
Private Attributes | |
QStackedWidget * | stack |
Stack of the top-level widgets. | |
QModelIndex | insertionIndex |
A helper index used when reacting to a setting data row insertion. |
List showing the individual setting items within one group.
The setting items are the first items in each row under the given group model index. All the data of the setting is saved in the same data item under various data roles. The view creates all the setting labels and editors at the time of its creation and then switches between different setting group pages in a QStackedWidget.
Updraft::Core::SettingsBottomView::SettingsBottomView | ( | QWidget * | parent | ) | [explicit] |
void Updraft::Core::SettingsBottomView::commit | ( | ) | [slot] |
Commits the data from editors into the model.
void Updraft::Core::SettingsBottomView::commitData | ( | QWidget * | editor | ) | [protected, slot] |
QWidget * Updraft::Core::SettingsBottomView::createEditorForIndex | ( | const QModelIndex & | index | ) | [protected] |
Helper method that creates an editor for the item at a given index.
The item's editor is created using the previously supplied delegate.
index | Model index of the item whose editor should be created. |
void Updraft::Core::SettingsBottomView::createEditors | ( | ) | [protected] |
Creates all the setting labels and editors.
The editors are created using the previously given delegate, which should be the SettingsDelegate instance. If the editors already exist, they are deleted and created again.
void Updraft::Core::SettingsBottomView::dataChanged | ( | const QModelIndex & | topLeft, |
const QModelIndex & | bottomRight | ||
) | [protected, slot] |
Reacts to the change of the data of a (set of) setting(s).
Currently supports only data changes of single settings. Therefore, the topLeft index must always equal to the bottomRight index.
topLeft | The top-left index of the set of items whose data has changed. |
bottomRight | The bottom-right index of the set of items whose data has changed. |
Tells whether there are any changes on the current page.
QString Updraft::Core::SettingsBottomView::getSettingDescription | ( | const QModelIndex & | settingIndex | ) | const [protected] |
Returns the description of the setting at the given index.
settingIndex | The model index of the setting whose description we want. |
int Updraft::Core::SettingsBottomView::horizontalOffset | ( | ) | const [protected] |
Currently unimplemented, but defined to be able to instantiate objects.
QModelIndex Updraft::Core::SettingsBottomView::indexAt | ( | const QPoint & | point | ) | const |
Gets the index of the item at the given point.
Currently not used and unimplemented.
point | Not used. |
bool Updraft::Core::SettingsBottomView::isIndexHidden | ( | const QModelIndex & | index | ) | const [protected] |
Currently unimplemented, but defined to be able to instantiate objects.
QModelIndex Updraft::Core::SettingsBottomView::moveCursor | ( | CursorAction | cursorAction, |
Qt::KeyboardModifiers | modifiers | ||
) | [protected] |
Reacts to the cursor movement over the view.
Currently unimplemented, but defined to be able to instantiate objects.
cursorAction | Not used |
modifiers | Not used |
void Updraft::Core::SettingsBottomView::paintEvent | ( | QPaintEvent * | event | ) | [protected] |
Reacts to the Qt repaint event.
event | The event information. |
void Updraft::Core::SettingsBottomView::reset | ( | ) | [slot] |
Resets the values in the editors to the values that are in the model.
void Updraft::Core::SettingsBottomView::resizeEvent | ( | QResizeEvent * | event | ) | [protected] |
Reacts to the Qt resize event.
event | The event information. |
void Updraft::Core::SettingsBottomView::restartInfo | ( | bool | needsRestart | ) | [signal] |
Signals whether there is a setting in the currently displayed page that needs the application to restart on its value change.
needsRestart | Whether there is a setting that needs the restart. |
void Updraft::Core::SettingsBottomView::rowsInserted | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [protected, slot] |
Reacts to a row insertion on the underlying model.
parent | The model index of the parent item, under which the new rows were inserted. |
start | The first index of the newly inserted rows. |
end | Index one-after the last inserted row. |
void Updraft::Core::SettingsBottomView::scrollTo | ( | const QModelIndex & | index, |
ScrollHint | hint = EnsureVisible |
||
) |
Scrolls to the given model index.
Currently not used and unimplemented.
index | Not used. |
hint | Not used. |
void Updraft::Core::SettingsBottomView::setItemDelegate | ( | QAbstractItemDelegate * | delegate | ) |
Sets the item delegate used by this view.
void Updraft::Core::SettingsBottomView::setModel | ( | QAbstractItemModel * | model | ) |
Sets the data model used by this view.
model | The data model used by this view. |
void Updraft::Core::SettingsBottomView::setSelection | ( | const QRect & | rect, |
QItemSelectionModel::SelectionFlags | flags | ||
) | [protected] |
Sets the selection in this view.
Currently unimplemented, but defined to be able to instantiate objects.
rect | Not used |
flags | Not used |
bool Updraft::Core::SettingsBottomView::settingNeedsRestart | ( | const QModelIndex & | settingIndex | ) | const [protected] |
Returns whether the given setting requires the application to restart if its value changes.
settingIndex | The model index of the setting |
void Updraft::Core::SettingsBottomView::setTopIndex | ( | const QModelIndex & | index | ) |
Reacts to the top view selected group index change.
It changes the index of the page of the stack widget that is being displayed.
index | Model index of the newly selected group. |
bool Updraft::Core::SettingsBottomView::someSettingNeedsRestart | ( | ) | [protected] |
Finds out whether there is a setting in the currently displayed group that needs the application to restart on its value change.
int Updraft::Core::SettingsBottomView::verticalOffset | ( | ) | const [protected] |
Gets vertical offset between the individual items.
QRect Updraft::Core::SettingsBottomView::visualRect | ( | const QModelIndex & | index | ) | const |
The visual rectangle that encapsulates the given model index.
Currently not used and unimplemented.
index | Not used. |
QRegion Updraft::Core::SettingsBottomView::visualRegionForSelection | ( | const QItemSelection & | selection | ) | const [protected] |
Returns a visual region corresponding to the given set of selected items.
Currently unimplemented, but defined to be able to instantiate objects.
selection | Not used |
QModelIndex Updraft::Core::SettingsBottomView::insertionIndex [private] |
A helper index used when reacting to a setting data row insertion.
QStackedWidget* Updraft::Core::SettingsBottomView::stack [private] |
Stack of the top-level widgets.