defuze.me
Client
|
00001 /************************************************************************** 00002 ** defuze.me Epitech Innovative Project 00003 ** 00004 ** Copyright 2010-2012 00005 ** Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard 00006 ** Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier 00007 ** 00008 ** All rights reserved. 00009 **************************************************************************/ 00010 00011 #ifndef LISTSDELEGATE_HPP 00012 #define LISTSDELEGATE_HPP 00013 00014 #include <QStyledItemDelegate> 00015 #include <QRegExpValidator> 00016 00017 namespace Lists 00018 { 00019 00020 class ListsDelegate : public QStyledItemDelegate 00021 { 00022 public: 00023 ListsDelegate(QObject *parent = 0); 00024 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; 00025 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; 00026 00027 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; 00028 void setEditorData(QWidget *editor, const QModelIndex &index) const; 00029 void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; 00030 void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; 00031 00032 private: 00033 QRegExp *editorRegEpx; 00034 }; 00035 00036 } 00037 00038 #endif // LISTSDELEGATE_HPP