2022-07-15 02:23:41 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QStyledItemDelegate>
|
|
|
|
|
|
|
|
/* Custom data types for our custom list models :) */
|
|
|
|
enum UserDataTypes {
|
|
|
|
TITLE = 257, // QString
|
|
|
|
DESCRIPTION = 258, // QString
|
2023-06-08 18:26:09 +01:00
|
|
|
SELECTED = 259, // bool
|
|
|
|
INSTALLED = 260 // bool
|
2022-07-15 02:23:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** This is an item delegate composed of:
|
|
|
|
* - An Icon on the left
|
|
|
|
* - A title
|
|
|
|
* - A description
|
|
|
|
* */
|
|
|
|
class ProjectItemDelegate final : public QStyledItemDelegate {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
public:
|
|
|
|
ProjectItemDelegate(QWidget* parent);
|
2022-07-15 02:23:41 +01:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override;
|
2022-07-15 02:23:41 +01:00
|
|
|
};
|