umbrello  2.31.3
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 
40  void emitDataChanged(const QModelIndex &index);
41  void emitDataChanged(int index);
42  void emitDataChanged(UMLView *view);
43 
44 protected:
45  int m_count;
47 };
48 
49 #endif // STEREOTYPESMODEL_H
UMLViewList m_views
Definition: diagramsmodel.h:46
bool removeDiagram(UMLView *view)
Definition: diagramsmodel.cpp:109
bool addDiagram(UMLView *view)
Definition: diagramsmodel.cpp:98
Definition: umlview.h:34
int m_count
Definition: diagramsmodel.h:45
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:67
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:26
Q_DECLARE_METATYPE(UMLView *)
DiagramsModel()
Definition: diagramsmodel.cpp:26
int columnCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:39
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: diagramsmodel.cpp:46
Definition: diagramsmodel.h:25
void emitDataChanged(const QModelIndex &index)
Definition: diagramsmodel.cpp:120
int rowCount(const QModelIndex &parent) const
Definition: diagramsmodel.cpp:31