VectorSearch/QVectorSearch/mainwindow.h

42 lines
900 B
C
Raw Normal View History

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 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);
std::unique_ptr<Finder> createSelectedFinder() const;
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