Mercurial > minori
comparison include/gui/pages/anime_list.h @ 273:f31305b9f60a
*: various code safety changes
this also makes the code build on Qt 5.7. I can't test it though
because I don't have it working... FAIL!
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Thu, 18 Apr 2024 16:53:17 -0400 |
parents | 3ec7804abf17 |
children | f6a756c19bfb |
comparison
equal
deleted
inserted
replaced
272:5437009cb10e | 273:f31305b9f60a |
---|---|
4 #include "core/anime.h" | 4 #include "core/anime.h" |
5 #include <QAbstractListModel> | 5 #include <QAbstractListModel> |
6 #include <QSortFilterProxyModel> | 6 #include <QSortFilterProxyModel> |
7 #include <QStyledItemDelegate> | 7 #include <QStyledItemDelegate> |
8 #include <QWidget> | 8 #include <QWidget> |
9 #include <QThread> | |
9 #include <vector> | 10 #include <vector> |
11 #include <queue> | |
10 | 12 |
11 class QTreeView; | 13 class QTreeView; |
12 class QTabBar; | 14 class QTabBar; |
15 class AnimeListPage; | |
16 | |
17 class AnimeListPageUpdateEntryThread final : public QThread { | |
18 public: | |
19 AnimeListPageUpdateEntryThread(AnimeListPage* parent); | |
20 | |
21 void AddToQueue(int id); | |
22 | |
23 protected: | |
24 void run() override; | |
25 | |
26 private: | |
27 AnimeListPage* page_ = nullptr; | |
28 std::queue<int> queue_; | |
29 }; | |
13 | 30 |
14 class AnimeListPageSortFilter final : public QSortFilterProxyModel { | 31 class AnimeListPageSortFilter final : public QSortFilterProxyModel { |
15 Q_OBJECT | 32 Q_OBJECT |
16 | 33 |
17 public: | 34 public: |
85 | 102 |
86 private: | 103 private: |
87 QTabBar* tab_bar; | 104 QTabBar* tab_bar; |
88 QTreeView* tree_view; | 105 QTreeView* tree_view; |
89 QRect panelRect; | 106 QRect panelRect; |
107 | |
108 AnimeListPageUpdateEntryThread update_entry_thread_; | |
90 std::array<AnimeListPageSortFilter*, 5> sort_models; | 109 std::array<AnimeListPageSortFilter*, 5> sort_models; |
91 }; | 110 }; |
92 | 111 |
93 #endif // MINORI_GUI_PAGES_ANIME_LIST_H_ | 112 #endif // MINORI_GUI_PAGES_ANIME_LIST_H_ |