Handle checkbox toggle

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2025-03-19 01:17:25 +00:00
parent 8577f58fe3
commit 900579eea6
24 changed files with 185 additions and 94 deletions

View File

@ -6,7 +6,7 @@
enum UserDataTypes {
TITLE = 257, // QString
DESCRIPTION = 258, // QString
INSTALLED = 260 // bool
INSTALLED = 259 // bool
};
/** This is an item delegate composed of:
@ -21,4 +21,12 @@ class ProjectItemDelegate final : public QStyledItemDelegate {
ProjectItemDelegate(QWidget* parent);
void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override;
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) override;
signals:
void checkboxClicked(const QModelIndex& index);
private:
QStyleOptionViewItem makeCheckboxStyleOption(const QStyleOptionViewItem& opt, const QStyle* style) const;
};