KTextWidgets 5.109.0
|
A generic "replace" dialog. More...
#include <KReplaceDialog>
Public Types | |
enum | Options { PromptOnReplace = 256 , BackReference = 512 } |
Options. More... | |
Public Member Functions | |
KReplaceDialog (QWidget *parent=nullptr, long options=0, const QStringList &findStrings=QStringList(), const QStringList &replaceStrings=QStringList(), bool hasSelection=true) | |
Construct a replace dialog.read-only or rather select-only combo box with a parent object and a name. | |
~KReplaceDialog () override | |
Destructor. | |
long | options () const |
Returns the state of the options. | |
QWidget * | replaceExtension () const |
Returns an empty widget which the user may fill with additional UI elements as required. | |
QString | replacement () const |
Returns the replacement string. | |
QStringList | replacementHistory () const |
Returns the list of history items. | |
void | setOptions (long options) |
Set the options which are enabled. | |
void | setReplacementHistory (const QStringList &history) |
Provide the list of strings to be displayed as the history of replacement strings. | |
![]() | |
KFindDialog (QWidget *parent=nullptr, long options=0, const QStringList &findStrings=QStringList(), bool hasSelection=false, bool replaceDialog=false) | |
Construct a modal find dialog. | |
~KFindDialog () override | |
Destructor. | |
QWidget * | findExtension () const |
Returns an empty widget which the user may fill with additional UI elements as required. | |
QStringList | findHistory () const |
Returns the list of history items. | |
long | options () const |
Returns the state of the options. | |
QString | pattern () const |
Returns the pattern to find. | |
void | setFindHistory (const QStringList &history) |
Provide the list of strings to be displayed as the history of find strings. | |
void | setHasCursor (bool hasCursor) |
Hide/show the 'from cursor' option, depending on whether the application implements a cursor. | |
void | setHasSelection (bool hasSelection) |
Enable/disable the 'search in selection' option, depending on whether there actually is a selection. | |
void | setOptions (long options) |
Set the options which are checked. | |
void | setPattern (const QString &pattern) |
Sets the pattern to find. | |
void | setSupportsBackwardsFind (bool supports) |
Enable/disable the 'Find backwards' option, depending on whether the application supports it. | |
void | setSupportsCaseSensitiveFind (bool supports) |
Enable/disable the 'Case sensitive' option, depending on whether the application supports it. | |
void | setSupportsRegularExpressionFind (bool supports) |
Enable/disable the 'Regular expression' option, depending on whether the application supports it. | |
void | setSupportsWholeWordsFind (bool supports) |
Enable/disable the 'Whole words only' option, depending on whether the application supports it. | |
Protected Member Functions | |
void | showEvent (QShowEvent *) override |
![]() | |
KTEXTWIDGETS_NO_EXPORT | KFindDialog (KFindDialogPrivate &dd, QWidget *parent=nullptr, long options=0, const QStringList &findStrings=QStringList(), bool hasSelection=false, bool replaceDialog=false) |
void | showEvent (QShowEvent *) override |
Additional Inherited Members | |
![]() | |
void | cancelClicked () |
This signal is sent when the user clicks on Cancel button. | |
void | okClicked () |
This signal is sent when the user clicks on Ok button. | |
void | optionsChanged () |
This signal is sent whenever one of the option checkboxes is toggled. | |
A generic "replace" dialog.
Detail:
This widget inherits from KFindDialog and implements the following additional functionalities: a replacement string object and an area for a user-defined widget to extend the dialog.
Example:
To use the basic replace dialog:
To use your own extensions:
|
explicit |
Construct a replace dialog.read-only or rather select-only combo box with a parent object and a name.
parent | The parent object of this widget |
options | A bitfield of the Options to be enabled. |
findStrings | A QStringList to insert in the combo box of text to find |
replaceStrings | A QStringList to insert in the combo box of text to replace with |
hasSelection | Whether a selection exists |
|
override |
Destructor.
long KReplaceDialog::options | ( | ) | const |
Returns the state of the options.
Disabled options may be returned in an indeterminate state.
QWidget * KReplaceDialog::replaceExtension | ( | ) | const |
Returns an empty widget which the user may fill with additional UI elements as required.
The widget occupies the width of the dialog, and is positioned immediately the regular expression support widgets for the replacement string.
QString KReplaceDialog::replacement | ( | ) | const |
Returns the replacement string.
QStringList KReplaceDialog::replacementHistory | ( | ) | const |
Returns the list of history items.
void KReplaceDialog::setOptions | ( | long | options | ) |
Set the options which are enabled.
options | The setting of the Options. |
void KReplaceDialog::setReplacementHistory | ( | const QStringList & | history | ) |
Provide the list of strings
to be displayed as the history of replacement strings.
strings
might get truncated if it is too long.
history | The replacement history. |