labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

SpreadsheetHeaderView.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : SpreadsheetHeaderView.h
3  Project : LabPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2016 Alexander Semke (alexander.semke@web.de)
6  Copyright : (C) 2007 by Tilman Benkert (thzs@gmx.net)
7  Description : Horizontal header for SpreadsheetView displaying comments in a second header
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 
30 #ifndef SPREADSHEETHEADERVIEW_H
31 #define SPREADSHEETHEADERVIEW_H
32 
33 #include <QHeaderView>
34 
35 class SpreadsheetCommentsHeaderView : public QHeaderView {
36  Q_OBJECT
37 
38 public:
39  explicit SpreadsheetCommentsHeaderView(QWidget* parent = nullptr);
41 
42  void setModel(QAbstractItemModel*) override;
43  friend class SpreadsheetHeaderView; // access to paintSection (protected)
44 };
45 
46 class SpreadsheetHeaderView : public QHeaderView {
47  Q_OBJECT
48 
49 public:
50  explicit SpreadsheetHeaderView(QWidget* parent = nullptr);
51  ~SpreadsheetHeaderView() override;
52 
53  void setModel(QAbstractItemModel*) override;
54  QSize sizeHint () const override;
55 
56  void showComments(bool on = true);
57  bool areCommentsShown() const;
58 
59 private:
62 
63 private slots:
64  void refresh();
65  void headerDataChanged(Qt::Orientation, int logicalFirst, int logicalLast);
66 
67 protected:
68  void paintSection(QPainter*, const QRect&, int logicalIndex) const override;
69 };
70 
71 #endif
Slave header for SpreadsheetDoubleHeaderView.
void setModel(QAbstractItemModel *) override
SpreadsheetCommentsHeaderView(QWidget *parent=nullptr)
QSize sizeHint() const override
void headerDataChanged(Qt::Orientation, int logicalFirst, int logicalLast)
SpreadsheetHeaderView(QWidget *parent=nullptr)
void setModel(QAbstractItemModel *) override
void paintSection(QPainter *, const QRect &, int logicalIndex) const override
SpreadsheetCommentsHeaderView * m_slave
void showComments(bool on=true)