comparison include/gui/pages/search.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
comparison
equal deleted inserted replaced
272:5437009cb10e 273:f31305b9f60a
5 5
6 #include <QAbstractListModel> 6 #include <QAbstractListModel>
7 #include <QFrame> 7 #include <QFrame>
8 #include <QItemSelection> 8 #include <QItemSelection>
9 #include <QSortFilterProxyModel> 9 #include <QSortFilterProxyModel>
10 #include <QThread>
10 11
11 class QTreeView; 12 class QTreeView;
13
14 class SearchPageSearchThread : public QThread {
15 Q_OBJECT
16
17 public:
18 SearchPageSearchThread(QObject* parent = nullptr);
19 void SetSearch(const std::string& search);
20
21 protected:
22 void run() override;
23
24 private:
25 std::string search_;
26
27 signals:
28 void GotResults(const std::vector<int>& search);
29 };
12 30
13 class SearchPageListSortFilter final : public QSortFilterProxyModel { 31 class SearchPageListSortFilter final : public QSortFilterProxyModel {
14 Q_OBJECT 32 Q_OBJECT
15 33
16 public: 34 public:
60 78
61 private: 79 private:
62 SearchPageListModel* model = nullptr; 80 SearchPageListModel* model = nullptr;
63 SearchPageListSortFilter* sort_model = nullptr; 81 SearchPageListSortFilter* sort_model = nullptr;
64 QTreeView* treeview = nullptr; 82 QTreeView* treeview = nullptr;
83
84 SearchPageSearchThread thread_;
65 }; 85 };
66 #endif // MINORI_GUI_PAGES_SEARCH_H_ 86 #endif // MINORI_GUI_PAGES_SEARCH_H_