-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtextsearchworker.h
More file actions
42 lines (33 loc) · 990 Bytes
/
textsearchworker.h
File metadata and controls
42 lines (33 loc) · 990 Bytes
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
35
36
37
38
39
40
41
42
#ifndef TEXTSEARCHWORKER_H
#define TEXTSEARCHWORKER_H
#include <QObject>
#include <QFile>
#include <QDir>
#include <QTextStream>
#include <QTextDocument>
#include <QTextCursor>
#include <QStandardItemModel>
#include <QFileIconProvider>
class TextSearchWorker : public QObject
{
Q_OBJECT
public:
explicit TextSearchWorker(QObject *parent = nullptr);
QStringList &getListPaths();
void setText(const QString &text);
void setRootPath(QString text);
public slots:
void doWork();
private:
QStringList listPaths;
QString text;
QString rootPath;
QStandardItemModel model;
QFileIconProvider iconProvider;
void findAllMatches(int &matchCount,QStandardItem *item, int &row, QTextDocument &document, int startPosition, QString &text);
QString extractNeighbourWords(QTextDocument &document, int position);
signals:
void finished();
void updateTextSearchView(QStandardItemModel *model, int matchCount);
};
#endif // TEXTSEARCHWORKER_H