TextFinder
-
class TextFinder : public QDialog
The TextFinder class helps to find particular text and replaces them with new user entered text.
At times, the user may want to find a particular text from a lengthy document to change it. It is time consuming for the user to go through each line to find and edit it. The TextFinder class offers functions that allows easy text search and replacement.
See also
getCurrentBrowser()
Public Functions
-
~TextFinder()
Destructor.
Public Static Functions
-
static TextFinder *openFindAndReplace(QWidget*)
The function checks if the window is already open else opens a new one.
- Parameters:
parent –
- Returns:
TextFinder*
Private Functions
-
explicit TextFinder(QWidget *parent = nullptr)
This Class is used to find and replace the text in text view.
1) Sets up the user interface for the specified widget. 2)Sets both the minimum and maximum sizes of the widget, thereby preventing it from ever growing or shrinking. 3)Installs an event filter filterObj on “this” object(findLineEdit,replaceLineEdit)
- Parameters:
parent –
Private Slots
-
void on_findNextButton_clicked()
Moves the cursor to the next identified text which the user entered to search.
-
void on_findPreviousButton_clicked()
Moves the cursor to the previously identified text which the user entered to search.
-
void on_replaceButton_clicked()
Replaces the current text under cursor with a new user entered text.
-
void on_replaceAllButton_clicked()
Replaces all the found text with a new user entered text.
-
void keyPressEvent(QKeyEvent*)
The function translates the user entered text on the textedit to Devanagari language when Ctrl+D is pressed.
See also
- Parameters:
e –
-
QString toDevanagari(string)
The function assess the user entered text language and converts the string of text into devanagari.
- Parameters:
text –
- Returns:
QString
-
bool eventFilter(QObject *watched, QEvent *event)
Filters the user key events and raises handlers if ‘ctrl + D’ is pressed.
See also
- Parameters:
watched –
event –
- Returns:
bool
-
bool stringCheck(QString path, QString searchstr)
Searches the string in a file.
1)Saves file path as string 2)Opens the File in readOnly mode 3)Sets the codec for this stream to codec(“UTF-8”) 4)Reads the entire content of the stream, and returns it as a QString. 5)closes the file 6)If string contains the specifics, function returns true else false
- Parameters:
path –
searchstr –
- Returns:
bool
-
~TextFinder()