2024-03-19 20:42:32 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2024-03-20 09:47:05 +00:00
|
|
|
#include "finder.h"
|
2024-03-19 20:42:32 +00:00
|
|
|
#include <QMainWindow>
|
2024-03-20 09:47:05 +00:00
|
|
|
#include <QStandardItemModel>
|
2024-03-20 09:16:46 +00:00
|
|
|
#include <QStringListModel>
|
2024-03-19 20:42:32 +00:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2024-03-20 09:16:46 +00:00
|
|
|
private:
|
|
|
|
std::vector<std::string> word_list_;
|
|
|
|
QStringListModel result_model_;
|
2024-03-20 09:47:05 +00:00
|
|
|
QStandardItemModel search_algorithms_;
|
2024-03-20 14:20:46 +00:00
|
|
|
std::unique_ptr<Finder> finder_;
|
2024-03-20 09:16:46 +00:00
|
|
|
|
2024-03-19 20:42:32 +00:00
|
|
|
public:
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
|
|
|
|
2024-03-20 09:16:46 +00:00
|
|
|
private:
|
2024-03-20 09:47:05 +00:00
|
|
|
void setupAlgorithmSelector();
|
|
|
|
void generateWordList();
|
|
|
|
void search(const QString &search_term);
|
2024-03-20 14:20:46 +00:00
|
|
|
void createSelectedFinder();
|
2024-03-20 12:25:28 +00:00
|
|
|
void showResults(const std::forward_list<const std::string *> &results);
|
2024-03-20 09:47:05 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_searchInput_textChanged(const QString &search_term);
|
|
|
|
void on_searchAlgorithmSelector_currentIndexChanged(int);
|
2024-03-20 09:16:46 +00:00
|
|
|
|
2024-03-19 20:42:32 +00:00
|
|
|
private:
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|