myre.h
1.03 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef MYRE_H
#define MYRE_H
#include <QMainWindow>
#include"common.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Myre; }
QT_END_NAMESPACE
using namespace DJY;
class Myre : public QMainWindow
{
Q_OBJECT
public:
Myre(QWidget *parent = nullptr);
~Myre();
QSet<QString> getAllMatchResults(const QString text,const QString regexp)
{
QSet<QString>resultSet;
QRegExp rx(regexp);
int pos=0;
while((pos=rx.indexIn(text,pos))!=-1)
{
pos += rx.matchedLength();
QString result=rx.cap(0);
resultSet<<result;
}
return resultSet;
}
private slots:
void on_pushButton_exit_clicked();
void on_pushButton_excute_clicked();
void init_myre();
void on_listView_clicked(const QModelIndex &index);
private:
Ui::Myre *ui;
QStringList Regs; //支持的正则表达式类型
QStringList RegValue; //对应的正则表达式内容
EasyQJson myjson;
QJsonObject rootObject;
QJsonArray rootArray;
};
#endif // MYRE_H