22 #ifndef GLSIMPLEENTITYITEMMODEL_H
23 #define GLSIMPLEENTITYITEMMODEL_H
25 #include <QAbstractItemModel>
27 #include <tulip/tulipconf.h>
33 class TLP_QT_SCOPE GlSimpleEntityItemEditor {
36 GlSimpleEntityItemEditor(GlSimpleEntity* ent):entity(ent) {}
37 virtual ~GlSimpleEntityItemEditor() {}
47 virtual QStringList propertiesNames()
const;
57 virtual QVariantList propertiesQVariant()
const;
70 virtual void setProperty(
const QString &name,
const QVariant &value);
74 GlSimpleEntity *entity;
78 class TLP_QT_SCOPE GlSimpleEntityItemModel :
public QAbstractItemModel {
80 Q_ENUMS(SimpleEntityRole)
83 enum SimpleEntityRole {
84 SimpleEntityRole = Qt::UserRole+1
87 GlSimpleEntityItemModel(GlSimpleEntityItemEditor *itemEditor, QObject *parent=NULL);
88 virtual ~GlSimpleEntityItemModel();
90 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
91 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
92 QModelIndex parent(
const QModelIndex &child)
const;
94 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
95 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex())
const;
96 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
98 QString headerText()
const {
99 return QString(
"toto");
102 bool setData(
const QModelIndex &index,
const QVariant &value,
int role);
104 Qt::ItemFlags flags(
const QModelIndex &index)
const {
105 return QAbstractItemModel::flags(index) | Qt::ItemIsEditable;
110 GlSimpleEntityItemEditor *editor;
115 #endif // GLSIMPLEENTITYITEMMODEL_H