scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

TableDoubleHeaderView.h
Go to the documentation of this file.
1 
11 
30 #ifndef TABLEDOUBLEHEADERVIEW_H
31 #define TABLEDOUBLEHEADERVIEW_H
32 
33 #include <QHeaderView>
34 #include "TableModel.h"
35 
37 
46 class TableCommentsHeaderView : public QHeaderView
47 {
48  Q_OBJECT
49 
50  public:
51  TableCommentsHeaderView(QWidget *parent = 0);
52  virtual ~TableCommentsHeaderView();
53 
54  virtual void setModel(QAbstractItemModel * model);
55 
56  friend class TableDoubleHeaderView; // access to paintSection (protected)
57 };
58 
60 /*
61  * This class is only to be used by TableView.
62  * It allows for displaying two horizontal headers.
63  * A TableDoubleHeaderView displays the column name, plot designation, and
64  * type icon in a normal QHeaderView and below that a second header
65  * which displays the column comments.
66  *
67  * \sa TableCommentsHeaderView
68  * \sa QHeaderView
69  */
70 class TableDoubleHeaderView : public QHeaderView
71 {
72  Q_OBJECT
73 
74  private:
76 
77  public:
78  TableDoubleHeaderView(QWidget * parent = 0);
80 
81  virtual void setModel(QAbstractItemModel * model);
82  virtual QSize sizeHint () const;
84  void showComments(bool on = true);
86  bool areCommentsShown() const;
87 
88  public slots:
89  // adjust geometry and repaint header
90  void refresh();
91  // React to a header data change
92  void headerDataChanged(Qt::Orientation orientation, int logicalFirst, int logicalLast);
93 
94  protected slots:
95  void sectionsInserted(const QModelIndex & parent, int logicalFirst, int logicalLast);
96 
97  protected:
98  virtual void paintSection(QPainter * painter, const QRect & rect, int logicalIndex) const;
99 
102 };
103 
104 
105 
106 
107 #endif // #ifndef TABLEDOUBLEHEADERVIEW_H
TableDoubleHeaderView::sizeHint
virtual QSize sizeHint() const
Definition: TableDoubleHeaderView.cpp:71
TableDoubleHeaderView::sectionsInserted
void sectionsInserted(const QModelIndex &parent, int logicalFirst, int logicalLast)
Definition: TableDoubleHeaderView.cpp:133
TableDoubleHeaderView
Horizontal header for TableView displaying comments in a second header.
Definition: TableDoubleHeaderView.h:71
TableCommentsHeaderView::TableCommentsHeaderView
TableCommentsHeaderView(QWidget *parent=0)
Definition: TableDoubleHeaderView.cpp:36
TableDoubleHeaderView::d_show_comments
bool d_show_comments
Flag: show/high column comments.
Definition: TableDoubleHeaderView.h:101
TableModel.h
TableDoubleHeaderView::setModel
virtual void setModel(QAbstractItemModel *model)
Definition: TableDoubleHeaderView.cpp:81
TableDoubleHeaderView::areCommentsShown
bool areCommentsShown() const
Return whether comments are show currently.
Definition: TableDoubleHeaderView.cpp:102
TableCommentsHeaderView::setModel
virtual void setModel(QAbstractItemModel *model)
Definition: TableDoubleHeaderView.cpp:46
TableDoubleHeaderView::TableDoubleHeaderView
TableDoubleHeaderView(QWidget *parent=0)
Definition: TableDoubleHeaderView.cpp:57
TableDoubleHeaderView::showComments
void showComments(bool on=true)
Show or hide (if on = false) the column comments.
Definition: TableDoubleHeaderView.cpp:107
TableCommentsHeaderView::~TableCommentsHeaderView
virtual ~TableCommentsHeaderView()
Definition: TableDoubleHeaderView.cpp:41
TableDoubleHeaderView::paintSection
virtual void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const
Definition: TableDoubleHeaderView.cpp:89
TableDoubleHeaderView::~TableDoubleHeaderView
~TableDoubleHeaderView()
Definition: TableDoubleHeaderView.cpp:66
TableDoubleHeaderView::refresh
void refresh()
Definition: TableDoubleHeaderView.cpp:113
TableDoubleHeaderView::headerDataChanged
void headerDataChanged(Qt::Orientation orientation, int logicalFirst, int logicalLast)
Definition: TableDoubleHeaderView.cpp:125
TableCommentsHeaderView
Slave header for TableDoubleHeaderView.
Definition: TableDoubleHeaderView.h:47
TableDoubleHeaderView::d_slave
TableCommentsHeaderView * d_slave
Definition: TableDoubleHeaderView.h:75