VectorSearch/QVectorSearch/mainwindow.h

51 lines
1.2 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "finder.h"
#include "word_list.h"
#include <QMainWindow>
#include <QStandardItemModel>
#include <QStringListModel>
#include <filesystem>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow {
Q_OBJECT
private:
WordList word_list_;
QStringListModel result_model_;
QStandardItemModel search_algorithms_;
QStandardItemModel word_list_sources_;
std::unique_ptr<Finder> finder_;
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
void setupAlgorithmSelector();
void setupWordListSourceSelector();
void setupWordList();
void generateWordList();
void loadWordList(std::filesystem::path path);
void search(const QString &search_term);
void createSelectedFinder();
void showResults(const std::forward_list<const std::string *> &results);
private slots:
void on_searchInput_textChanged(const QString &search_term);
void on_searchAlgorithmSelector_currentIndexChanged(int);
void on_wordListSourceSelector_currentIndexChanged(int);
void on_wordListSizeSelector_valueChanged(int);
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H