umbrello  26.08.1
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 
18 class DiagramsModel : public QAbstractTableModel
19 {
20  Q_OBJECT
21 public:
22  explicit DiagramsModel();
23 
24  int rowCount(const QModelIndex &parent) const;
25  int columnCount(const QModelIndex &parent) const;
26 
27  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
28  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
29 
30  bool addDiagram(UMLView *view);
31  bool removeDiagram(UMLView *view);
32  bool removeAllDiagrams();
33 
34  void emitDataChanged(const QModelIndex &index);
35  void emitDataChanged(int index);
36  void emitDataChanged(UMLView *view);
37 
38 protected:
39  int m_count;
41 };
42 
43 #endif // STEREOTYPESMODEL_H
UMLViewList m_views
Definition: diagramsmodel.h:40
bool removeAllDiagrams()
Definition: diagramsmodel.cpp:115
bool removeDiagram(UMLView *view)
Definition: diagramsmodel.cpp:104
bool addDiagram(UMLView *view)
Definition: diagramsmodel.cpp:93
Definition: umlview.h:29
int m_count
Definition: diagramsmodel.h:39
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:62
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:14
DiagramsModel()
Definition: diagramsmodel.cpp:21
int columnCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:34
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:41
Definition: diagramsmodel.h:18
void emitDataChanged(const QModelIndex &index)
Definition: diagramsmodel.cpp:125
int rowCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:26