umbrello  2.31.3
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
void emitDataChanged(const QModelIndex &index)
Definition: objectsmodel.cpp:170
Definition: objectsmodel.h:20
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: objectsmodel.cpp:72
QList< QPointer< UMLObject > > m_allObjects
Definition: objectsmodel.h:40
The base class for UML objects.
Definition: umlobject.h:73
int rowCount(const QModelIndex &parent) const
Definition: objectsmodel.cpp:57
int columnCount(const QModelIndex &parent) const
Definition: objectsmodel.cpp:65
ObjectsModel()
Definition: objectsmodel.cpp:31
bool add(UMLObject *o)
Definition: objectsmodel.cpp:35
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: objectsmodel.cpp:99