00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_SEQUENCE_VIEWER_SEQUENCE_TABLE_VIEW
00020 #define OST_SEQUENCE_VIEWER_SEQUENCE_TABLE_VIEW
00021
00022
00023
00024
00025
00026 #include <QTableView>
00027 #include <QWheelEvent>
00028
00029 #include <ost/gui/module_config.hh>
00030
00031 #include "sequence_delegate.hh"
00032
00033 namespace ost { namespace gui {
00034
00036 class DLLEXPORT_OST_GUI SequenceTableView : public QTableView {
00037 Q_OBJECT
00038 public:
00039 SequenceTableView(QAbstractItemModel * model);
00040 QTableView* GetStaticRow();
00041 QTableView* GetStaticColumn();
00042 QTableView* GetStaticField();
00043 ~SequenceTableView();
00044
00045 signals:
00046 void MouseWheelEvent(QWheelEvent* event);
00047 void CopyEvent(QKeyEvent* event);
00048
00049 public slots:
00050 void columnCountChanged(const QModelIndex& index, int old_count, int new_count);
00051 void rowCountChanged(const QModelIndex& index, int old_count, int new_count);
00052 void resizeColumnsToContents();
00053 void resizeRowsToContents();
00054
00055 protected:
00056 virtual void mouseDoubleClickEvent(QMouseEvent* event);
00057 virtual void mouseReleaseEvent(QMouseEvent* event);
00058 virtual void resizeEvent(QResizeEvent* event);
00059 virtual void wheelEvent(QWheelEvent* event);
00060 virtual void keyPressEvent(QKeyEvent* event);
00061 virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers);
00062 void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible);
00063
00064 private slots:
00065 void InitStaticColumn();
00066 void InitStaticRow();
00067 void InitStaticField();
00068 void ResizeWidth(int index, int, int size);
00069 void ResizeHeight(int index, int, int size);
00070
00071 private:
00072 QTableView* static_column_;
00073 QTableView* static_row_;
00074 QTableView* static_field_;
00075 SequenceDelegate* delegate_;
00076 QModelIndex last_double_click_;
00077 void updateStaticColumn();
00078 void updateStaticRow();
00079 void updateStaticField();
00080 };
00081
00082 }}
00083
00084 #endif