Skip to content

A custom working Qt-based dialog with Find, Replace and RegEX search functionalities based on the Extension Example.

License

Notifications You must be signed in to change notification settings

Yet-Zio/QFindDialogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QFindDialogs

A custom working Qt-based dialog with Find, Replace and RegEX search functionalities based on the Extension Example. You are Free to use this project under the BSD-3 Clause License. Please refer the License Terms for your project compatibility. There are two available dialogs:

Public Functions (FindDialog)

Type Function
explicit FindDialog(QWidget *parent = nullptr)
void setEditor(QPlainTextEdit *editor)
QPlainTextEdit* getEditor()

Private Slots (FindDialog)

Type Function
void find()
void regexMode()

Public Functions (FindReplaceDialog)

Type Function
explicit FindReplaceDialog(QWidget *parent = nullptr)
void setEditor(QPlainTextEdit *editor)
QPlainTextEdit* getEditor()

Private Slots (FindReplaceDialog)

Type Function
void find()
void replace()
void replaceAll()
void regexMode()

FindDialog

Sample Images:

FindDialog

The more button expands the remaining available options with its individual functionality provided as seen here:

FindExpandedDialog

FindReplaceDialog

Sample Images:

FindReplaceDialog

The more button expands the same as it expanded before in FindDialog with the options.

Documentation

Public Functions

explicit FindDialog::FindDialog(QWidget *parent = nullptr)

Constructs a Find Dialog with the given parent.
FindDialog inherits from QDialog.

void FindDialog::setEditor(QPlainTextEdit *editor)

Sets the current active editor of the find dialog object to the specified one.

QPlainTextEdit* FindDialog::getEditor()

Returns the current active editor of the find dialog object.

void FindDialog::find()

Finds the query text from the find field in the editor, sets a selection to the found substring and sets the cursor at the end.
find() checks various checkboxes and does the exact search function.

void FindDialog::regexMode()

If regex-CheckBox is ticked, this method runs ensuring a Regular Expression mode for the find dialog to
search in the current editor. The find() then searches for a QRegularExpression in the Editor.

explicit FindReplaceDialog::FindReplaceDialog(QWidget *parent = nullptr)

Constructs a Find and Replace Dialog with the given parent.
FindReplaceDialog inherits from QDialog and contains all the functions and properties from FindDialog.

void FindReplaceDialog::setEditor(QPlainTextEdit *editor)

Sets the current active editor of the find and replace dialog object to the specified one.

QPlainTextEdit* FindReplaceDialog::getEditor()

Returns the current active editor of the find and replace dialog object.

void FindReplaceDialog::find()

Finds the query text from the find field in the editor, sets a selection to the found substring and sets the cursor at the end.
find() checks various checkboxes and does the exact search function.

void FindReplaceDialog::replace()

Replaces the query selected by the find() and sets the cursor at the end of the replaced substring.

void FindReplaceDialog::replaceAll()

Replaces all occurences of the query selected by find() and the sets the cursor at the end of the last substring replaced.

void FindReplaceDialog::regexMode()

If regex-CheckBox is ticked, this method runs ensuring a Regular Expression mode for the find dialog to
search in the current editor. The find() then searches for a QRegularExpression in the Editor.

Usage

FindDialog

QPlainTextEdit *myEditor = new QPlainTextEdit;
FindDialog *fdialog = new FindDialog(this);
fdialog->setEditor(myEditor);
fdialog->show();

FindReplaceDialog

QPlainTextEdit *myEditor = new QPlainTextEdit;
FindReplaceDialog *frDialog = new FindReplaceDialog(this);
frdialog->setEditor(myEditor);
frdialog->show();

About

A custom working Qt-based dialog with Find, Replace and RegEX search functionalities based on the Extension Example.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages