1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef PROJECTDELEGATE_H |
6 | #define PROJECTDELEGATE_H |
7 | |
8 | #include <QStyledItemDelegate> |
9 | |
10 | class ProjectDelegatePrivate; |
11 | class ProjectDelegate : public QStyledItemDelegate |
12 | { |
13 | Q_OBJECT |
14 | ProjectDelegatePrivate *const d; |
15 | public: |
16 | explicit ProjectDelegate(QObject *parent = nullptr); |
17 | void setActiveProject(const QModelIndex &root); |
18 | const QModelIndex &getActiveProject() const; |
19 | |
20 | protected: |
21 | void paint(QPainter *painter, |
22 | const QStyleOptionViewItem &option, |
23 | const QModelIndex &index) const override; |
24 | }; |
25 | |
26 | #endif // PROJECTDELEGATE_H |
27 |