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
00023
00024
00025
00026 #ifndef DISTANCEDELEGATE_H
00027 #define DISTANCEDELEGATE_H
00028
00029 #include <QtGui>
00030
00031 class DistanceDelegate : public QItemDelegate
00032 {
00033 Q_OBJECT
00034 public:
00035 DistanceDelegate(QObject * parent);
00036
00037 void setNames(const QStringList& n) {_names=n;}
00038
00039 QWidget * createEditor(QWidget * parent, const QStyleOptionViewItem &,
00040 const QModelIndex & index) const;
00041 void setEditorData(QWidget *editor, const QModelIndex &index) const;
00042 void setModelData(QWidget *editor, QAbstractItemModel *model,
00043 const QModelIndex &index) const;
00044 bool editingValue() const {return _editingValue>0;}
00045 private slots:
00046 void valueEditorDestroyed();
00047 void valueChanged();
00048 private:
00049 QStringList _names;
00050 mutable int _editingValue;
00051 };
00052
00053 #endif // DISTANCEDELEGATE_H