Mercurial > minori
diff 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 |
line wrap: on
line diff
--- a/include/gui/pages/search.h Thu Apr 18 16:51:35 2024 -0400 +++ b/include/gui/pages/search.h Thu Apr 18 16:53:17 2024 -0400 @@ -7,9 +7,27 @@ #include <QFrame> #include <QItemSelection> #include <QSortFilterProxyModel> +#include <QThread> class QTreeView; +class SearchPageSearchThread : public QThread { + Q_OBJECT + +public: + SearchPageSearchThread(QObject* parent = nullptr); + void SetSearch(const std::string& search); + +protected: + void run() override; + +private: + std::string search_; + +signals: + void GotResults(const std::vector<int>& search); +}; + class SearchPageListSortFilter final : public QSortFilterProxyModel { Q_OBJECT @@ -62,5 +80,7 @@ SearchPageListModel* model = nullptr; SearchPageListSortFilter* sort_model = nullptr; QTreeView* treeview = nullptr; + + SearchPageSearchThread thread_; }; #endif // MINORI_GUI_PAGES_SEARCH_H_