VectorSearch/QVectorSearch/mainwindow.h

42 lines
894 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_;
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
void setupAlgorithmSelector();
void generateWordList();
void search(const QString &search_term);
std::unique_ptr<Finder> createSelectedFinder() const;
void showResults(const std::vector<const std::string *> &results);
private slots:
void on_searchInput_textChanged(const QString &search_term);
void on_searchAlgorithmSelector_currentIndexChanged(int);
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H