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;
42 explicit TulipItemDelegate(QObject* parent=NULL);
43 virtual ~TulipItemDelegate();
46 void registerCreator(tlp::TulipItemEditorCreator*);
48 void unregisterCreator(tlp::TulipItemEditorCreator*);
51 void unregisterCreator();
54 tlp::TulipItemEditorCreator* creator()
const;
56 tlp::TulipItemEditorCreator* creator(
int)
const;
58 QWidget* createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const;
59 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
60 QString displayText(
const QVariant &value,
const QLocale &locale)
const;
61 void setEditorData(QWidget *editor,
const QModelIndex &index)
const;
62 void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index)
const;
63 QSize sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
65 bool eventFilter(QObject *
object, QEvent *event);
68 void comboDataChanged();
73 #include "cxx/TulipItemDelegate.cxx"
75 #endif // TULIPITEMDELEGATE_H