/*============================================================================ ** ** Project/Product : ** Filename : textdelegate.h ** Author(s) : DDP ** ** Description : A delgated widget to assist in the editing of text items ** within a table ** ** ***==========================================================================*/ #ifndef TEXTDELEGATE_H #define TEXTDELEGATE_H #include #include #include #include #include class textDelegate : public QItemDelegate { Q_OBJECT public: explicit textDelegate(int maxlen = 100, QObject *parent = 0); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; int max_len; signals: public slots: }; #endif // TEXTDELEGATE_H