summaryrefslogtreecommitdiff
path: root/qhexedit2/example/searchdialog.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-07-07 12:37:21 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-07-07 12:37:21 +0200
commitfebaef00017278ac65cb7e285564ebc9d5dadfe5 (patch)
tree940ac1386117785496334432dc03a3c0cfa02de5 /qhexedit2/example/searchdialog.h
parentf41f2dce18111c923c331a3fe6900edee731d040 (diff)
parent004b73ed7ef33cb407897f7eccbec5f3861f99d7 (diff)
Merge commit '004b73ed7ef33cb407897f7eccbec5f3861f99d7' as 'qhexedit2'
Diffstat (limited to 'qhexedit2/example/searchdialog.h')
-rw-r--r--qhexedit2/example/searchdialog.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/qhexedit2/example/searchdialog.h b/qhexedit2/example/searchdialog.h
new file mode 100644
index 0000000..74ab867
--- /dev/null
+++ b/qhexedit2/example/searchdialog.h
@@ -0,0 +1,34 @@
+#ifndef SEARCHDIALOG_H
+#define SEARCHDIALOG_H
+
+#include <QDialog>
+#include <QtCore>
+#include "../src/qhexedit.h"
+
+namespace Ui {
+ class SearchDialog;
+}
+
+class SearchDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit SearchDialog(QHexEdit *hexEdit, QWidget *parent = 0);
+ ~SearchDialog();
+ qint64 findNext();
+ Ui::SearchDialog *ui;
+
+private slots:
+ void on_pbFind_clicked();
+ void on_pbReplace_clicked();
+ void on_pbReplaceAll_clicked();
+
+private:
+ QByteArray getContent(int comboIndex, const QString &input);
+ qint64 replaceOccurrence(qint64 idx, const QByteArray &replaceBa);
+
+ QHexEdit *_hexEdit;
+ QByteArray _findBa;
+};
+
+#endif // SEARCHDIALOG_H