umbrello  2.31.0
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
stereotypesmodel.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) 2015 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef STEREOTYPESMODEL_H
12 #define STEREOTYPESMODEL_H
13 
14 // app includes
15 #include "umlstereotypelist.h"
16 
17 // qt includes
18 #include <QAbstractTableModel>
19 
20 class UMLStereotype;
21 
23 
24 class StereotypesModel : public QAbstractTableModel
25 {
26  Q_OBJECT
27 public:
28  explicit StereotypesModel(UMLStereotypeList *stereotypes);
29 
30  int rowCount(const QModelIndex &parent) const;
31  int columnCount(const QModelIndex &parent) const;
32 
33  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
34  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
35 
36  bool addStereotype(UMLStereotype *stereotype);
37  bool removeStereotype(UMLStereotype *stereotype);
38 
39  void emitDataChanged(const QModelIndex &index);
40  void emitDataChanged(int index);
41 
42 protected:
43  int m_count;
45 };
46 
47 #endif // STEREOTYPESMODEL_H
stereotypesmodel.h
StereotypesModel::m_stereotypes
UMLStereotypeList * m_stereotypes
Definition: stereotypesmodel.h:44
stereotype.h
UMLStereotypeList
QList< UMLStereotype * > UMLStereotypeList
Definition: umlstereotypelist.h:17
StereotypesModel
Definition: stereotypesmodel.h:24
UMLStereotype::name
QString name(bool includeAdornments=false) const
Definition: stereotype.cpp:147
UMLStereotype::refCount
int refCount() const
Definition: stereotype.cpp:139
StereotypesModel::rowCount
int rowCount(const QModelIndex &parent) const
Definition: stereotypesmodel.cpp:30
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(UMLStereotype *)
UMLStereotype
Sets up stereotype information.
Definition: stereotype.h:40
StereotypesModel::m_count
int m_count
Definition: stereotypesmodel.h:43
StereotypesModel::removeStereotype
bool removeStereotype(UMLStereotype *stereotype)
Definition: stereotypesmodel.cpp:101
a
QString a
Definition: petalnode.cpp:18
umlstereotypelist.h
i18n
#define i18n
Definition: main.cpp:39
StereotypesModel::emitDataChanged
void emitDataChanged(const QModelIndex &index)
Definition: stereotypesmodel.cpp:112
StereotypesModel::columnCount
int columnCount(const QModelIndex &parent) const
Definition: stereotypesmodel.cpp:38
v
std::vector< std::string > v
Definition: cxx11-initializer-lists.h:19
StereotypesModel::addStereotype
bool addStereotype(UMLStereotype *stereotype)
Definition: stereotypesmodel.cpp:90
uml.h
StereotypesModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: stereotypesmodel.cpp:62
StereotypesModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: stereotypesmodel.cpp:45
StereotypesModel::StereotypesModel
StereotypesModel(UMLStereotypeList *stereotypes)
Definition: stereotypesmodel.cpp:24
umldoc.h