21 #ifndef TULIPITEMDELEGATE_H
22 #define TULIPITEMDELEGATE_H
24 #include <QtGui/QStyledItemDelegate>
25 #include "tulip/TulipItemEditorCreators.h"
29 class TLP_QT_SCOPE TulipItemDelegate :
public QStyledItemDelegate {
32 QMap<int,TulipItemEditorCreator*> _creators;
34 QObject* _currentMonitoredChild;
35 QComboBox* _currentMonitoredCombo;
40 explicit TulipItemDelegate(QObject* parent=NULL);
41 virtual ~TulipItemDelegate();
44 void registerCreator(tlp::TulipItemEditorCreator*);
46 void unregisterCreator(tlp::TulipItemEditorCreator*);
49 void unregisterCreator();
52 tlp::TulipItemEditorCreator* creator()
const;
54 tlp::TulipItemEditorCreator* creator(
int)
const;
56 QWidget* createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const;
57 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
58 QString displayText(
const QVariant &value,
const QLocale &locale)
const;
59 void setEditorData(QWidget *editor,
const QModelIndex &index)
const;
60 void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index)
const;
61 QSize sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
63 bool eventFilter(QObject *
object, QEvent *event);
66 void comboDataChanged();
71 #include "cxx/TulipItemDelegate.cxx"
73 #endif // TULIPITEMDELEGATE_H