47 lines
991 B
C++
47 lines
991 B
C++
#ifndef SEARCHEDIT_H
|
|
#define SEARCHEDIT_H
|
|
|
|
#include <QEvent>
|
|
#include <QLineEdit>
|
|
#include <QMutex>
|
|
#include "ksearchlineedit.h"
|
|
#include "searchserver.h"
|
|
#include "fileinfo.h"
|
|
|
|
using namespace kdk;
|
|
|
|
class SearchEdit : public KSearchLineEdit
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
SearchEdit(QWidget *parent = nullptr);
|
|
~SearchEdit();
|
|
|
|
public Q_SLOTS:
|
|
void onSearchInstalled(bool isUpdated, QString searchInfoPath);
|
|
void onReturnPressed();
|
|
|
|
protected:
|
|
void focusInEvent(QFocusEvent *event);
|
|
void focusOutEvent(QFocusEvent *event);
|
|
|
|
private Q_SLOTS:
|
|
void onTextChanged();
|
|
|
|
Q_SIGNALS:
|
|
void sigEditFocusIn();
|
|
void sigEditFocusOut();
|
|
void sigSearchLineShow();
|
|
void sigSearchInitFail();
|
|
void sigSearchResult(const QMap<QString, FileInfo> &searchResult);
|
|
void sigSearchKeyword(QString query);
|
|
|
|
private:
|
|
SearchServer *m_searchServer = nullptr;
|
|
QString m_query = "";
|
|
QMap<QString, FileInfo> m_resultMap;
|
|
QMutex m_mutex;
|
|
};
|
|
|
|
#endif // SEARCHEDIT_H
|