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)  

MatrixModel.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : MatrixModel.h
3  Project : LabPlot
4  Description : Matrix data model
5  --------------------------------------------------------------------
6  Copyright : (C) 2015 Alexander Semke (alexander.semke@web.de)
7  Copyright : (C) 2008-2009 Tilman Benkert (thzs@gmx.net)
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 MATRIXMODEL_H
31 #define MATRIXMODEL_H
32 
33 #include <QAbstractItemModel>
34 
35 class Matrix;
36 
37 class MatrixModel : public QAbstractItemModel {
38  Q_OBJECT
39 
40 public:
41  explicit MatrixModel(Matrix*);
42 
43  //! \name Overloaded functions from QAbstractItemModel
44  //@{
45  Qt::ItemFlags flags(const QModelIndex&) const override;
46  QVariant data(const QModelIndex& index, int role) const override;
47  QVariant headerData(int section, Qt::Orientation orientation,int role = Qt::DisplayRole) const override;
48  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
49  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
50  bool setData(const QModelIndex& index, const QVariant& value, int role) override;
51  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
52  QModelIndex parent(const QModelIndex& child) const override;
53  //@}
54 
55  void updateHeader();
57  void setChanged();
58 
59 private slots:
60  void handleColumnsAboutToBeInserted(int before, int count);
61  void handleColumnsInserted(int first, int count);
62  void handleColumnsAboutToBeRemoved(int first, int count);
63  void handleColumnsRemoved(int first, int count);
64  void handleRowsAboutToBeInserted(int before, int count);
65  void handleRowsInserted(int first, int count);
66  void handleRowsAboutToBeRemoved(int first, int count);
67  void handleRowsRemoved(int first, int count);
68  void handleDataChanged(int top, int left, int bottom, int right);
70  void handleFormatChanged();
71 
72 private:
75 
76 signals:
77  void changed();
78 };
79 
80 #endif
Model for the access to data of a Matrix-object.
Definition: MatrixModel.h:37
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
void handleRowsInserted(int first, int count)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
QModelIndex parent(const QModelIndex &child) const override
void handleColumnsRemoved(int first, int count)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void handleRowsRemoved(int first, int count)
void handleRowsAboutToBeRemoved(int first, int count)
void changed()
void handleColumnsAboutToBeRemoved(int first, int count)
MatrixModel(Matrix *)
Definition: MatrixModel.cpp:48
bool m_suppressDataChangedSignal
Definition: MatrixModel.h:74
void setChanged()
Definition: MatrixModel.cpp:67
Matrix * m_matrix
Definition: MatrixModel.h:73
void handleCoordinatesChanged()
QVariant data(const QModelIndex &index, int role) const override
Definition: MatrixModel.cpp:78
void updateHeader()
void setSuppressDataChangedSignal(bool)
Definition: MatrixModel.cpp:63
void handleRowsAboutToBeInserted(int before, int count)
void handleDataChanged(int top, int left, int bottom, int right)
void handleColumnsAboutToBeInserted(int before, int count)
bool setData(const QModelIndex &index, const QVariant &value, int role) override
void handleFormatChanged()
Qt::ItemFlags flags(const QModelIndex &) const override
Definition: MatrixModel.cpp:71
void handleColumnsInserted(int first, int count)
Definition: Matrix.h:41