Mercurial > minori
comparison include/gui/pages/anime_list.h @ 63:3d2decf093bb
*: fix many clang warnings
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 01 Oct 2023 06:39:47 -0400 |
parents | cde8f67a7c7d |
children | fe719c109dbc |
comparison
equal
deleted
inserted
replaced
62:4c6dd5999b39 | 63:3d2decf093bb |
---|---|
7 #include <QTreeView> | 7 #include <QTreeView> |
8 #include <QWidget> | 8 #include <QWidget> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 class AnimeListWidgetDelegate : public QStyledItemDelegate { | 11 class AnimeListWidgetDelegate : public QStyledItemDelegate { |
12 Q_OBJECT | 12 Q_OBJECT |
13 | 13 |
14 public: | 14 public: |
15 explicit AnimeListWidgetDelegate(QObject* parent); | 15 explicit AnimeListWidgetDelegate(QObject* parent); |
16 | 16 |
17 QWidget* createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const override; | 17 QWidget* createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const override; |
18 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; | 18 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; |
19 }; | 19 }; |
20 | 20 |
21 class AnimeListWidgetSortFilter : public QSortFilterProxyModel { | 21 class AnimeListWidgetSortFilter : public QSortFilterProxyModel { |
22 Q_OBJECT | 22 Q_OBJECT |
23 | 23 |
24 public: | 24 public: |
25 AnimeListWidgetSortFilter(QObject* parent = nullptr); | 25 AnimeListWidgetSortFilter(QObject* parent = nullptr); |
26 | 26 |
27 protected: | 27 protected: |
28 bool lessThan(const QModelIndex& l, const QModelIndex& r) const override; | 28 bool lessThan(const QModelIndex& l, const QModelIndex& r) const override; |
29 }; | 29 }; |
30 | 30 |
31 class AnimeListWidgetModel : public QAbstractListModel { | 31 class AnimeListWidgetModel : public QAbstractListModel { |
32 Q_OBJECT | 32 Q_OBJECT |
33 | 33 |
34 public: | 34 public: |
35 enum columns { | 35 enum columns { |
36 AL_TITLE, | 36 AL_TITLE, |
37 AL_PROGRESS, | 37 AL_PROGRESS, |
64 }; | 64 }; |
65 | 65 |
66 /* todo: rename these to "page" or something more | 66 /* todo: rename these to "page" or something more |
67 sensible than "widget" */ | 67 sensible than "widget" */ |
68 class AnimeListWidget : public QWidget { | 68 class AnimeListWidget : public QWidget { |
69 Q_OBJECT | 69 Q_OBJECT |
70 | 70 |
71 public: | 71 public: |
72 AnimeListWidget(QWidget* parent); | 72 AnimeListWidget(QWidget* parent); |
73 void Refresh(); | 73 void Refresh(); |
74 void Reset(); | 74 void Reset(); |