umbrello: umbrello/models/stereotypesmodel.h Source File

umbrello 2.38.5 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

stereotypesmodel.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2015-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef STEREOTYPESMODEL_H
7#define STEREOTYPESMODEL_H
8
9// app includes
10#include "umlstereotypelist.h"
11
12// qt includes
13#include <QAbstractTableModel>
14
15class UMLStereotype;
16
17Q_DECLARE_METATYPE(UMLStereotype*);
18
19 class StereotypesModel : public QAbstractTableModel
20{
21 Q_OBJECT
22public:
23 explicit StereotypesModel(UMLStereotypeList& stereotypes);
24
25 int rowCount(const QModelIndex &parent) const;
26 int columnCount(const QModelIndex &parent) const;
27
28 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
29 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
30
31 bool addStereotype(UMLStereotype *stereotype);
32 bool removeStereotype(UMLStereotype *stereotype);
33
34 void emitDataChanged(const QModelIndex &index);
35 void emitDataChanged(int index);
36
37protected:
38 int m_count;
39 UMLStereotypeList& m_stereotypes;
40};
41
42#endif // STEREOTYPESMODEL_H
StereotypesModel
Definition stereotypesmodel.h:20
StereotypesModel::m_count
int m_count
Definition stereotypesmodel.h:38
StereotypesModel::columnCount
int columnCount(const QModelIndex &parent) const
Definition stereotypesmodel.cpp:33
StereotypesModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition stereotypesmodel.cpp:40
StereotypesModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition stereotypesmodel.cpp:57
StereotypesModel::StereotypesModel
StereotypesModel(UMLStereotypeList &stereotypes)
Definition stereotypesmodel.cpp:19
StereotypesModel::m_stereotypes
UMLStereotypeList & m_stereotypes
Definition stereotypesmodel.h:39
StereotypesModel::emitDataChanged
void emitDataChanged(const QModelIndex &index)
Definition stereotypesmodel.cpp:122
StereotypesModel::rowCount
int rowCount(const QModelIndex &parent) const
Definition stereotypesmodel.cpp:25
StereotypesModel::removeStereotype
bool removeStereotype(UMLStereotype *stereotype)
Definition stereotypesmodel.cpp:101
StereotypesModel::addStereotype
bool addStereotype(UMLStereotype *stereotype)
Definition stereotypesmodel.cpp:85
UMLStereotype
Sets up stereotype information.
Definition stereotype.h:36
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(UMLStereotype *)
umlstereotypelist.h
UMLStereotypeList
QList< UMLStereotype * > UMLStereotypeList
Definition umlstereotypelist.h:14