umbrello: umbrello/models/objectsmodel.h Source File

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

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

- File List
- File Members

objectsmodel.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2016-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef OBJECTSMODEL_H
7#define OBJECTSMODEL_H
8
9// qt includes
10#include <QAbstractTableModel>
11#include <QPointer>
12
13class UMLObject;
14
15 class ObjectsModel : public QAbstractTableModel
16{
17 Q_OBJECT
18public:
19 explicit ObjectsModel();
20
21 bool add(UMLObject *o);
22 bool remove(UMLObject *o);
23
24 int rowCount(const QModelIndex &parent) const;
25 int columnCount(const QModelIndex &parent) const;
26
27 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
28 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
29
30 void emitDataChanged(const QModelIndex &index);
31 void emitDataChanged(int index);
32 void emitDataChanged(UMLObject *o);
33
34protected:
35 QList<QPointer<UMLObject>> m_allObjects;
36};
37
38#endif // OBJECTSMODEL_H
ObjectsModel
Definition objectsmodel.h:16
ObjectsModel::emitDataChanged
void emitDataChanged(const QModelIndex &index)
Definition objectsmodel.cpp:167
ObjectsModel::remove
bool remove(UMLObject *o)
Definition objectsmodel.cpp:41
ObjectsModel::add
bool add(UMLObject *o)
Definition objectsmodel.cpp:30
ObjectsModel::rowCount
int rowCount(const QModelIndex &parent) const
Definition objectsmodel.cpp:52
ObjectsModel::m_allObjects
QList< QPointer< UMLObject > > m_allObjects
Definition objectsmodel.h:35
ObjectsModel::columnCount
int columnCount(const QModelIndex &parent) const
Definition objectsmodel.cpp:60
ObjectsModel::ObjectsModel
ObjectsModel()
Definition objectsmodel.cpp:26
ObjectsModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition objectsmodel.cpp:67
ObjectsModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition objectsmodel.cpp:94
UMLObject
The base class for UML objects.
Definition umlobject.h:70