Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
FindReplaceDialog.h
Go to the documentation of this file.
1#pragma once
2
3#include <QDialog>
4#include <QTextCursor>
5
6class QPlainTextEdit;
7
8class QCheckBox;
9
10class QDialogButtonBox;
11
12class QGroupBox;
13
14class QLabel;
15
16class QLineEdit;
17
18class QPushButton;
19
20namespace sf
21{
22
26class FindReplaceDialog :public QDialog
27{
28 Q_OBJECT
29
30 public:
34 explicit FindReplaceDialog(QWidget* parent = nullptr);
35
40
44 void setEditor(QPlainTextEdit* editor)
45 {
46 _editor = editor;
47 }
48
52 QPlainTextEdit* getEditor()
53 {
54 return _editor;
55 }
56
57 protected:
58 void showEvent(QShowEvent* event) override;
59
60 private Q_SLOTS:
61
62 bool find();
63
64 void replace();
65
66 void replaceAll();
67
68 void regexMode();
69
70 private:
71
72 QPlainTextEdit* _editor{nullptr};
73
74 QLabel* lblFind;
75 QLabel* lblReplace;
76 QLineEdit* leFind;
77 QCheckBox* cbRegex;
78 QLineEdit* leReplaceField;
79 QCheckBox* cbCase;
80 QCheckBox* cbWholeWords;
81 QCheckBox* cbSearchSelection;
82 QCheckBox* cbBackward;
83 QDialogButtonBox* buttonBox;
84 QPushButton* btnFind;
85 QPushButton* btnReplace;
86 QPushButton* btnReplaceAll;
87 QPushButton* btnShowMore;
88 QWidget* extension;
89
90 QTextCursor cursor;
91
92 void resizeToContent();
93};
94
95}
Find and replace dialog for a QPlainTextEdit widget.
Definition FindReplaceDialog.h:27
QPlainTextEdit * getEditor()
Gets the editor widget it acts on.
Definition FindReplaceDialog.h:52
void setEditor(QPlainTextEdit *editor)
Sets the editor widget to act on.
Definition FindReplaceDialog.h:44
void showEvent(QShowEvent *event) override
~FindReplaceDialog() override
Destructor.
FindReplaceDialog(QWidget *parent=nullptr)
Constructor.
Definition Application.h:10