Updraft  1.0
Open source glider flight visualisation tool.
settingsbottomview.h
Go to the documentation of this file.
00001 #ifndef UPDRAFT_SRC_CORE_UI_SETTINGSBOTTOMVIEW_H_
00002 #define UPDRAFT_SRC_CORE_UI_SETTINGSBOTTOMVIEW_H_
00003 
00004 #include <QtGui>
00005 
00006 namespace Updraft {
00007 namespace Core {
00008 
00009 // TODO(cestmir): This needs heavy documenting
00010 
00017 class SettingsBottomView: public QAbstractItemView {
00018   Q_OBJECT
00019 
00020  public:
00021   explicit SettingsBottomView(QWidget* parent);
00022   ~SettingsBottomView();
00023 
00028   QModelIndex indexAt(const QPoint& point) const;
00029 
00034   void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
00035 
00040   QRect visualRect(const QModelIndex& index) const;
00041 
00044   bool editorValuesChanged();
00045 
00048   void setModel(QAbstractItemModel* model);
00049 
00054   void setTopIndex(const QModelIndex& index);
00055 
00057   void setItemDelegate(QAbstractItemDelegate *delegate);
00058 
00059  public slots:
00061   void commit();
00063   void reset();
00064 
00065  signals:
00069   void restartInfo(bool needsRestart);
00070 
00071  protected:
00076   void createEditors();
00077 
00082   QWidget* createEditorForIndex(const QModelIndex& index);
00083 
00086   void paintEvent(QPaintEvent* event);
00087 
00090   void resizeEvent(QResizeEvent* event);
00091 
00094   int horizontalOffset() const;
00095 
00098   bool isIndexHidden(const QModelIndex & index) const;
00099 
00105   QString getSettingDescription(const QModelIndex& settingIndex) const;
00106 
00112   bool settingNeedsRestart(const QModelIndex& settingIndex) const;
00113 
00119   QModelIndex moveCursor(CursorAction cursorAction,
00120     Qt::KeyboardModifiers modifiers);
00121 
00126   void setSelection(const QRect & rect,
00127     QItemSelectionModel::SelectionFlags flags);
00128 
00131   int verticalOffset() const;
00132 
00137   QRegion visualRegionForSelection(const QItemSelection & selection) const;
00138 
00142   bool someSettingNeedsRestart();
00143 
00144  protected slots:
00149   void commitData(QWidget* editor);
00150 
00158   void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
00159 
00165   void rowsInserted(const QModelIndex& parent, int start, int end);
00166 
00167  private:
00169   QStackedWidget* stack;
00170 
00172   QModelIndex insertionIndex;
00173 };
00174 
00175 }  // End namespace Core
00176 }  // End namespace Updraft
00177 
00178 #endif  // UPDRAFT_SRC_CORE_UI_SETTINGSBOTTOMVIEW_H_
00179 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines