umbrello 2.39.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- File List
- File Members

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 Q_DECLARE_METATYPE(UMLView*);
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;
42 UMLViewList m_views;
43};
44
45#endif // STEREOTYPESMODEL_H
DiagramsModel
Definition diagramsmodel.h:21
DiagramsModel::emitDataChanged
void emitDataChanged(const QModelIndex &index)
Definition diagramsmodel.cpp:125
DiagramsModel::removeDiagram
bool removeDiagram(UMLView *view)
Definition diagramsmodel.cpp:104
DiagramsModel::m_views
UMLViewList m_views
Definition diagramsmodel.h:42
DiagramsModel::addDiagram
bool addDiagram(UMLView *view)
Definition diagramsmodel.cpp:93
DiagramsModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition diagramsmodel.cpp:62
DiagramsModel::m_count
int m_count
Definition diagramsmodel.h:41
DiagramsModel::DiagramsModel
DiagramsModel()
Definition diagramsmodel.cpp:21
DiagramsModel::removeAllDiagrams
bool removeAllDiagrams()
Definition diagramsmodel.cpp:115
DiagramsModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition diagramsmodel.cpp:41
DiagramsModel::columnCount
int columnCount(const QModelIndex &parent) const
Definition diagramsmodel.cpp:34
DiagramsModel::rowCount
int rowCount(const QModelIndex &parent) const
Definition diagramsmodel.cpp:26
UMLView
Definition umlview.h:30
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(UMLView *)
umlviewlist.h
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition umlviewlist.h:16