#ifndef SIMSTATEDELEGATE_H
#define SIMSTATEDELEGATE_H

#include <QItemDelegate>

namespace DESpot
{
class SimStateDelegate : public QItemDelegate
{
    Q_OBJECT

public:
    SimStateDelegate(int stateColumn, QObject *parent = 0);

    void paint(QPainter *painter, const QStyleOptionViewItem &option,
               const QModelIndex &index) const;
    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;

private slots:
    void commitAndCloseEditor();

private:
    int stateColumn;
};
}
#endif
