#ifndef CASSETDELEGATE_H #define CASSETDELEGATE_H #include #include "CAssetCommon.h" class CAssetTableModel; class CAssetDelegate : public QStyledItemDelegate { Q_OBJECT public: CAssetDelegate(CAssetTableModel *model, QObject *parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; protected: bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) Q_DECL_OVERRIDE; signals: void sigOpenAssetRecord(const AssetInfo &info); private: CAssetTableModel * m_pModel; QString style; }; #endif // CASSETDELEGATE_H