umbrello: umbrello/models/objectsmodel.h Source File

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

objectsmodel.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) 2016-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef OBJECTSMODEL_H
12 #define OBJECTSMODEL_H
13
14 // qt includes
15 #include <QAbstractTableModel>
16 #include <QPointer>
17
18 class UMLObject;
19
20 class ObjectsModel : public QAbstractTableModel
21 {
22 Q_OBJECT
23 public:
24 explicit ObjectsModel();
25
26 bool add(UMLObject *o);
27 bool remove(UMLObject *o);
28
29 int rowCount(const QModelIndex &parent) const;
30 int columnCount(const QModelIndex &parent) const;
31
32 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
33 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
34
35 void emitDataChanged(const QModelIndex &index);
36 void emitDataChanged(int index);
37 void emitDataChanged(UMLObject *o);
38
39 protected:
40 QList<QPointer<UMLObject>> m_allObjects;
41 };
42
43 #endif // OBJECTSMODEL_H
ObjectsModel
Definition: objectsmodel.h:21
ObjectsModel::emitDataChanged
void emitDataChanged(const QModelIndex &index)
Definition: objectsmodel.cpp:172
ObjectsModel::remove
bool remove(UMLObject *o)
Definition: objectsmodel.cpp:46
ObjectsModel::add
bool add(UMLObject *o)
Definition: objectsmodel.cpp:35
ObjectsModel::rowCount
int rowCount(const QModelIndex &parent) const
Definition: objectsmodel.cpp:57
ObjectsModel::m_allObjects
QList< QPointer< UMLObject > > m_allObjects
Definition: objectsmodel.h:40
ObjectsModel::columnCount
int columnCount(const QModelIndex &parent) const
Definition: objectsmodel.cpp:65
ObjectsModel::ObjectsModel
ObjectsModel()
Definition: objectsmodel.cpp:31
ObjectsModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: objectsmodel.cpp:72
ObjectsModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: objectsmodel.cpp:99
UMLObject
The base class for UML objects.
Definition: umlobject.h:75