#ifndef DATEDELEGATE_H
#define DATEDELEGATE_H

#include <QItemDelegate>

#include <QDateTimeEdit>

class DateDelegate : public QItemDelegate
{
public:
    DateDelegate(QObject *parent=0,QString format="yyyy");

    QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;

private:
    QString m_formate; // 时间格式化的格式
};

#endif // DATEDELEGATE_H