#pragma once #include #include "iPlugin_global.h" // 通用数据编辑代理对象类 class I_PLUGIN_EXPORT ZxDataEditorDelegate : public QItemDelegate { Q_OBJECT public: explicit ZxDataEditorDelegate(QObject* parent = 0); virtual ~ZxDataEditorDelegate(); public: // 函数重载部分 void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(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; void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; bool eventFilter(QObject* object, QEvent* event); signals: public slots: private: mutable QWidget* m_editedWidget; };