mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 13:22:04 +08:00
chore:将信息显示在主界面上
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
#ifndef APPDELEGATE_H
|
||||
#define APPDELEGATE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QPainter>
|
||||
// 添加 QEvent 头文件
|
||||
#include <QEvent>
|
||||
|
||||
class AppDelegate : public QObject
|
||||
class AppDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AppDelegate(QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
// 重写方法
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
|
||||
};
|
||||
|
||||
#endif // APPDELEGATE_H
|
||||
|
||||
Reference in New Issue
Block a user