parley
kvttabledelegate.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KVTTABLEDELEGATE_H
00023 #define KVTTABLEDELEGATE_H
00024
00025 #include <QItemDelegate>
00026 #include <QModelIndex>
00027
00031 class KVTTableDelegate : public QItemDelegate
00032 {
00033 Q_OBJECT
00034 public:
00035 KVTTableDelegate(QObject *parent = 0);
00036
00037 QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00038
00039 void setEditorData(QWidget *editor, const QModelIndex &index) const;
00040 void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
00041 void setCurrentIndex(const QModelIndex &index);
00042
00043 void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00044 QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
00045 void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
00046 protected:
00047 void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const;
00048 void drawFocus(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect) const;
00049
00050 private slots:
00051 void commitAndCloseEditor();
00052
00053 private:
00060
00061 QModelIndex m_currentIndex;
00062 };
00063
00064 #endif