2020-12-24 11:06:19 +08:00
|
|
|
#ifndef SEARCHLISTVIEW_H
|
|
|
|
#define SEARCHLISTVIEW_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QTreeView>
|
|
|
|
#include "model/search-item-model.h"
|
|
|
|
#include "model/search-item.h"
|
|
|
|
|
|
|
|
class SearchListView : public QTreeView
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-12-25 19:16:44 +08:00
|
|
|
explicit SearchListView(QWidget *, const QStringList&, const int&);
|
2020-12-24 11:06:19 +08:00
|
|
|
~SearchListView();
|
|
|
|
|
2020-12-25 19:16:44 +08:00
|
|
|
enum ResType { //搜索结果可能出现的类型:应用、文件、设置、文件夹
|
|
|
|
App,
|
|
|
|
File,
|
|
|
|
Setting,
|
|
|
|
Dir
|
|
|
|
};
|
|
|
|
|
|
|
|
int getCurrentType();
|
|
|
|
int getResType(const QString&);
|
|
|
|
|
2020-12-24 11:06:19 +08:00
|
|
|
private:
|
|
|
|
SearchItemModel * m_model = nullptr;
|
|
|
|
SearchItem * m_item = nullptr;
|
2020-12-25 19:16:44 +08:00
|
|
|
|
|
|
|
int m_type;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void currentRowChanged(const int&, const QString&);
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void clearSelection();
|
2020-12-24 11:06:19 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SEARCHLISTVIEW_H
|