summaryrefslogtreecommitdiffstats
path: root/searchdialog.h
blob: ac4f73d9de1fce26579d6c09cc3afdc394e8c387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef SEARCHDIALOG_H
#define SEARCHDIALOG_H

#include <QDialog>

class QLineEdit;
class QComboBox;
class QTreeView;
class QStandardItemModel;

class SearchDialog : public QDialog {
    Q_OBJECT
    public:
        enum SearchTypes { Filename, Title };
        enum CustomRoles { IdRole = 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 doSearchFilename();
        void doResultName(const QModelIndex &sel, int resType);

    private:
        QLineEdit *mSearch;
        QComboBox *mTypeSel;
        QTreeView *mResV;
        QTreeView *mDataV;
        QStandardItemModel *mResM;
        QStandardItemModel *mDataM;
};

#endif // SEARCHDIALOG_H