21 #ifndef TULIPITEMDELEGATE_H
22 #define TULIPITEMDELEGATE_H
24 #include <QStyledItemDelegate>
27 #include <tulip/TulipMetaTypes.h>
28 #include <tulip/TulipItemEditorCreators.h>
32 class TLP_QT_SCOPE TulipItemDelegate :
public QStyledItemDelegate {
35 QMap<int, TulipItemEditorCreator *> _creators;
37 QObject *_currentMonitoredChild;
38 QComboBox *_currentMonitoredCombo;
42 TulipItemDelegate *, QWidget *dialogParent =
nullptr,
43 unsigned int id = UINT_MAX, QString title =
"");
45 explicit TulipItemDelegate(QObject *parent =
nullptr);
46 ~TulipItemDelegate()
override;
49 void registerCreator(tlp::TulipItemEditorCreator *);
51 void unregisterCreator(tlp::TulipItemEditorCreator *);
54 void unregisterCreator();
57 tlp::TulipItemEditorCreator *creator()
const;
59 tlp::TulipItemEditorCreator *creator(
int)
const;
61 QWidget *createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
62 const QModelIndex &index)
const override;
63 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
64 const QModelIndex &index)
const override;
65 QString displayText(
const QVariant &value,
const QLocale &locale)
const override;
66 void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
67 void setModelData(QWidget *editor, QAbstractItemModel *model,
68 const QModelIndex &index)
const override;
69 QSize sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
71 bool eventFilter(QObject *
object, QEvent *event)
override;
74 void comboDataChanged();
78 #include "cxx/TulipItemDelegate.cxx"
PropertyInterface describes the interface of a graph property.