发布网友 发布时间:2022-04-22 05:50
共1个回答
热心网友 时间:2023-07-20 03:06
看一下ButtonDelegate的代码
#ifndef BUTTONDELEGATE_H
#define BUTTONDELEGATE_H
#include <QItemDelegate>
class ButtonDelegate : public QItemDelegate
{
Q_OBJECT
public:
explicit ButtonDelegate(QObject *parent = 0);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);
signals:
public slots: