21 #ifndef TULIPITEMDELEGATE_H 22 #define TULIPITEMDELEGATE_H 24 #include <QStyledItemDelegate> 26 #include <tulip/TulipItemEditorCreators.h> 27 #include <tulip/TulipMetaTypes.h> 31 class TLP_QT_SCOPE TulipItemDelegate :
public QStyledItemDelegate {
34 QMap<int, TulipItemEditorCreator *> _creators;
36 QObject *_currentMonitoredChild;
37 QComboBox *_currentMonitoredCombo;
41 TulipItemDelegate *, QWidget *dialogParent =
nullptr,
42 unsigned int id = UINT_MAX);
44 explicit TulipItemDelegate(QObject *parent =
nullptr);
45 ~TulipItemDelegate()
override;
48 void registerCreator(tlp::TulipItemEditorCreator *);
50 void unregisterCreator(tlp::TulipItemEditorCreator *);
53 void unregisterCreator();
56 tlp::TulipItemEditorCreator *creator()
const;
58 tlp::TulipItemEditorCreator *creator(
int)
const;
60 QWidget *createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
61 const QModelIndex &index)
const override;
62 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
63 const QModelIndex &index)
const override;
64 QString displayText(
const QVariant &value,
const QLocale &locale)
const override;
65 void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
66 void setModelData(QWidget *editor, QAbstractItemModel *model,
67 const QModelIndex &index)
const override;
68 QSize sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
70 bool eventFilter(QObject *
object, QEvent *event)
override;
73 void comboDataChanged();
77 #include "cxx/TulipItemDelegate.cxx" 79 #endif // TULIPITEMDELEGATE_H
PropertyInterface describes the interface of a graph property.