comparison include/gui/pages/anime_list.h @ 95:8043152ef9d4

include: set classes as final where appropriate
author Paper <mrpapersonic@gmail.com>
date Wed, 01 Nov 2023 14:39:43 -0400
parents c69230dc2b5d
children 2004b41d4a59
comparison
equal deleted inserted replaced
94:2f373d48f889 95:8043152ef9d4
9 #include <vector> 9 #include <vector>
10 10
11 class QTreeView; 11 class QTreeView;
12 class QTabBar; 12 class QTabBar;
13 13
14 class AnimeListPageDelegate : public QStyledItemDelegate { 14 class AnimeListPageDelegate final : public QStyledItemDelegate {
15 Q_OBJECT 15 Q_OBJECT
16 16
17 public: 17 public:
18 explicit AnimeListPageDelegate(QObject* parent); 18 explicit AnimeListPageDelegate(QObject* parent);
19 19
20 QWidget* createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const override; 20 QWidget* createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const override;
21 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; 21 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
22 }; 22 };
23 23
24 class AnimeListPageSortFilter : public QSortFilterProxyModel { 24 class AnimeListPageSortFilter final : public QSortFilterProxyModel {
25 Q_OBJECT 25 Q_OBJECT
26 26
27 public: 27 public:
28 AnimeListPageSortFilter(QObject* parent = nullptr); 28 AnimeListPageSortFilter(QObject* parent = nullptr);
29 29
30 protected: 30 protected:
31 bool lessThan(const QModelIndex& l, const QModelIndex& r) const override; 31 bool lessThan(const QModelIndex& l, const QModelIndex& r) const override;
32 }; 32 };
33 33
34 class AnimeListPageModel : public QAbstractListModel { 34 class AnimeListPageModel final : public QAbstractListModel {
35 Q_OBJECT 35 Q_OBJECT
36 36
37 public: 37 public:
38 enum columns { 38 enum columns {
39 AL_TITLE, 39 AL_TITLE,
65 std::vector<Anime::Anime> list; 65 std::vector<Anime::Anime> list;
66 }; 66 };
67 67
68 /* todo: rename these to "page" or something more 68 /* todo: rename these to "page" or something more
69 sensible than "widget" */ 69 sensible than "widget" */
70 class AnimeListPage : public QWidget { 70 class AnimeListPage final : public QWidget {
71 Q_OBJECT 71 Q_OBJECT
72 72
73 public: 73 public:
74 AnimeListPage(QWidget* parent); 74 AnimeListPage(QWidget* parent);
75 void Refresh(); 75 void Refresh();