From 2a14c0ebca1d781b7279e1ed8d657364d70df46d Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 1 Feb 2018 16:37:44 +0100 Subject: Implement a useful search Display Title and Filename search as non-modal dialog, so one can compare Files and Database. For now only Title search is implemented. Filename search does nothing (yet). --- searchdialog.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 searchdialog.h (limited to 'searchdialog.h') diff --git a/searchdialog.h b/searchdialog.h new file mode 100644 index 0000000..bfa2443 --- /dev/null +++ b/searchdialog.h @@ -0,0 +1,34 @@ +#ifndef SEARCHDIALOG_H +#define SEARCHDIALOG_H + +#include + +class QLineEdit; +class QComboBox; +class QTreeView; +class QStandardItemModel; + +class SearchDialog : public QDialog { + Q_OBJECT + public: + enum SearchTypes { Filename, Title }; + enum CustomRoles { SeriesIdRole = Qt::UserRole + 1}; + explicit SearchDialog(QWidget *parent, Qt::WindowFlags f = 0); + + public slots: + void doSearch(); + void doResult(const QModelIndex &cur, const QModelIndex &prev); + void doSearchTitle(); + void doResultTitle(const QModelIndex &sel); + + + private: + QLineEdit *mSearch; + QComboBox *mTypeSel; + QTreeView *mResV; + QTreeView *mDataV; + QStandardItemModel *mResM; + QStandardItemModel *mDataM; +}; + +#endif // SEARCHDIALOG_H -- cgit v1.2.3-70-g09d2