#ifndef CMONTHLYITEMDELEGATE_H #define CMONTHLYITEMDELEGATE_H #include #include #include #include #include class cMonthlyItemDelegate : public QStyledItemDelegate { Q_OBJECT public: cMonthlyItemDelegate(const QMap& code, QObject* parent = nullptr); ~cMonthlyItemDelegate(); virtual QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; virtual void setEditorData(QWidget *editor, const QModelIndex &index) const; virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; signals: void timeChanged(const int day, const int field, const QTime& time) const; void textChanged(const int day, const int field, const QString& text) const; private: QMap m_code; }; #endif // CMONTHLYITEMDELEGATE_H