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

List showing the individual setting items within one group. More...

#include <settingsbottomview.h>

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation


Member Function Documentation

Commits the data from editors into the model.

void Updraft::Core::SettingsBottomView::commitData ( QWidget *  editor) [protected, slot]

Commits the data of the given editor.

Not used. A different mechanism is used for data commiting. See methods commit() and reset().

Parameters:
editorNot used
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.

Parameters:
indexModel index of the item whose editor should be created.
Returns:
Pointer to the newly created editor.

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.

Parameters:
topLeftThe top-left index of the set of items whose data has changed.
bottomRightThe bottom-right index of the set of items whose data has changed.

Tells whether there are any changes on the current page.

Returns:
Whether the values on the current page have changed.
QString Updraft::Core::SettingsBottomView::getSettingDescription ( const QModelIndex &  settingIndex) const [protected]

Returns the description of the setting at the given index.

Parameters:
settingIndexThe model index of the setting whose description we want.
Returns:
String value that was set as the description for the given setting.

Currently unimplemented, but defined to be able to instantiate objects.

Returns:
0
QModelIndex Updraft::Core::SettingsBottomView::indexAt ( const QPoint &  point) const

Gets the index of the item at the given point.

Currently not used and unimplemented.

Parameters:
pointNot used.
Returns:
Invalid model index.
bool Updraft::Core::SettingsBottomView::isIndexHidden ( const QModelIndex &  index) const [protected]

Currently unimplemented, but defined to be able to instantiate objects.

Returns:
false
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.

Parameters:
cursorActionNot used
modifiersNot used
Returns:
Invalid model index
void Updraft::Core::SettingsBottomView::paintEvent ( QPaintEvent *  event) [protected]

Reacts to the Qt repaint event.

Parameters:
eventThe event information.

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.

Parameters:
eventThe 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.

Parameters:
needsRestartWhether 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.

Parameters:
parentThe model index of the parent item, under which the new rows were inserted.
startThe first index of the newly inserted rows.
endIndex 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.

Parameters:
indexNot used.
hintNot 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.

Parameters:
modelThe 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.

Parameters:
rectNot used
flagsNot 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.

Parameters:
settingIndexThe model index of the setting
Returns:
Whether the setting at the given index reqires a restart on value change.
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.

Parameters:
indexModel index of the newly selected group.

Finds out whether there is a setting in the currently displayed group that needs the application to restart on its value change.

Returns:
Whether there is such setting in the current group.

Gets vertical offset between the individual items.

Returns:
5
QRect Updraft::Core::SettingsBottomView::visualRect ( const QModelIndex &  index) const

The visual rectangle that encapsulates the given model index.

Currently not used and unimplemented.

Parameters:
indexNot used.
Returns:
Empty rectangle.
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.

Parameters:
selectionNot used
Returns:
Invalid QRegion

Member Data Documentation

A helper index used when reacting to a setting data row insertion.

QStackedWidget* Updraft::Core::SettingsBottomView::stack [private]

Stack of the top-level widgets.


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