-
Notifications
You must be signed in to change notification settings - Fork 0
/
SearchDialog.h
63 lines (48 loc) · 1.25 KB
/
SearchDialog.h
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
58
59
60
61
62
63
#ifndef SEARCHDIALOG_H
#define SEARCHDIALOG_H
#include <QGridLayout>
#include <QDialog>
#include <QPushButton>
#include <QGroupBox>
#include <QCheckBox>
#include <QComboBox>
#include <QLabel>
#include <QMessageBox>
#include "qhexedit.h"
class SearchDialog : public QDialog
{
Q_OBJECT
public:
explicit SearchDialog(QHexEdit *hexEdit,QWidget *parent = nullptr);
explicit SearchDialog(QWidget *parent = nullptr);
~SearchDialog();
qint64 findR();
qint64 findNext();
qint64 findPre();
void replace();
void replaceAll();
void setHexEdit(QHexEdit *hex_edit);
private:
void init();
QGroupBox *findGroup;
QComboBox *find_ComboBox;
QComboBox *find_ContentBox;
QGroupBox *replaceGroup;
QComboBox *replace_ComboBox;
QComboBox *replace_ContentBox;
QGroupBox *optionGroup;
QCheckBox *pre_Check;
QCheckBox *tip_Check;
QGroupBox *tipGroup;
QLabel *tip_Label;
QPushButton *findBtn;
QPushButton *replaceBtn;
QPushButton *replaceAllBtn;
QPushButton *closeBtn;
private:
QByteArray getContent(int comboIndex, const QString &input);
qint64 replaceOccurrence(qint64 idx, const QByteArray &replaceBa);
QHexEdit *_hexEdit;
QByteArray _findBa;
};
#endif // SEARCHDIALOG_H