umbrello  2.39.2
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
diagramsmodel.h
Go to the documentation of this file.
1 /*
2  SPDX-License-Identifier: GPL-2.0-or-later
3  SPDX-FileCopyrightText: 2015-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4 */
5 
6 #ifndef DIAGRAMSMODEL_H
7 #define DIAGRAMSMODEL_H
8 
9 // app includes
10 #include "umlviewlist.h"
11 
12 // qt includes
13 #include <QAbstractTableModel>
14 #include <QPointer>
15 
16 class UMLView;
17 
19 
20 class DiagramsModel : public QAbstractTableModel
21 {
22  Q_OBJECT
23 public:
24  explicit DiagramsModel();
25 
26  int rowCount(const QModelIndex &parent) const;
27  int columnCount(const QModelIndex &parent) const;
28 
29  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
30  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
31 
32  bool addDiagram(UMLView *view);
33  bool removeDiagram(UMLView *view);
34  bool removeAllDiagrams();
35 
36  void emitDataChanged(const QModelIndex &index);
37  void emitDataChanged(int index);
38  void emitDataChanged(UMLView *view);
39 
40 protected:
41  int m_count;
43 };
44 
45 #endif // STEREOTYPESMODEL_H
Definition: diagramsmodel.h:21
void emitDataChanged(const QModelIndex &index)
Definition: diagramsmodel.cpp:125
bool removeDiagram(UMLView *view)
Definition: diagramsmodel.cpp:104
UMLViewList m_views
Definition: diagramsmodel.h:42
bool addDiagram(UMLView *view)
Definition: diagramsmodel.cpp:93
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:62
int m_count
Definition: diagramsmodel.h:41
DiagramsModel()
Definition: diagramsmodel.cpp:21
bool removeAllDiagrams()
Definition: diagramsmodel.cpp:115
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:41
int columnCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:34
int rowCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:26
Definition: umlview.h:30
Q_DECLARE_METATYPE(UMLView *)
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:14