This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
VectorSearch/QVectorSearch/mainwindow.h

44 lines
970 B
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "finder.h"
#include <QMainWindow>
#include <QStandardItemModel>
#include <QStringListModel>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow {
Q_OBJECT
private:
std::vector<std::string> word_list_;
QStringListModel result_model_;
QStandardItemModel search_algorithms_;
std::unique_ptr<Finder> finder_;
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
void setupAlgorithmSelector();
void generateWordList();
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_wordListSizeSelector_valueChanged(int new_value);
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H