umbrello  2.32.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  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2015-2020 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef DIAGRAMSMODEL_H
12 #define DIAGRAMSMODEL_H
13 
14 // app includes
15 #include "umlviewlist.h"
16 
17 // qt includes
18 #include <QAbstractTableModel>
19 #include <QPointer>
20 
21 class UMLView;
22 
24 
25 class DiagramsModel : public QAbstractTableModel
26 {
27  Q_OBJECT
28 public:
29  explicit DiagramsModel();
30 
31  int rowCount(const QModelIndex &parent) const;
32  int columnCount(const QModelIndex &parent) const;
33 
34  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
35  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
36 
37  bool addDiagram(UMLView *view);
38  bool removeDiagram(UMLView *view);
39  bool removeAllDiagrams();
40 
41  void emitDataChanged(const QModelIndex &index);
42  void emitDataChanged(int index);
43  void emitDataChanged(UMLView *view);
44 
45 protected:
46  int m_count;
48 };
49 
50 #endif // STEREOTYPESMODEL_H
Definition: diagramsmodel.h:26
void emitDataChanged(const QModelIndex &index)
Definition: diagramsmodel.cpp:130
bool removeDiagram(UMLView *view)
Definition: diagramsmodel.cpp:109
UMLViewList m_views
Definition: diagramsmodel.h:47
bool addDiagram(UMLView *view)
Definition: diagramsmodel.cpp:98
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:67
int m_count
Definition: diagramsmodel.h:46
DiagramsModel()
Definition: diagramsmodel.cpp:26
bool removeAllDiagrams()
Definition: diagramsmodel.cpp:120
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:46
int columnCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:39
int rowCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:31
Definition: umlview.h:35
Q_DECLARE_METATYPE(UMLView *)
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:26