KDE 4.2 PyKDE API Reference

- KDE's Python API

# KReplaceDialog Class Reference

`from PyKDE4.kdeui import *`

Inherits: KFindDialog → KDialog → QDialog → QWidget → QObject

## Detailed Description

A generic "replace" dialog.

Author:
  S.R.Haque <srhaque@iee.org>

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:

## Enumerations

Options | { PromptOnReplace, BackReference }

## Methods

| __init__ (self, QWidget parent=0, long options=0, QStringList findStrings=QStringList(), QStringList replaceStrings=QStringList(), bool hasSelection=1)
long | options (self)
QWidget | replaceExtension (self)
QString | replacement (self)
QStringList | replacementHistory (self)
| setOptions (self, long options)
| setReplacementHistory (self, QStringList history)
| showEvent (self, QShowEvent a0)

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0,
|  | long | options=0,
|  | QStringList | findStrings=QStringList(),
|  | QStringList | replaceStrings=QStringList(),
|  | bool | hasSelection=1
| ) |  |  |

Construct a replace dialog.read-only or rather select-only combo box with a parent object and a name.

Parameters:

  | 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

long options | ( |  | self ) |

Returns the state of the options. Disabled options may be returned in an indeterminate state.

See also:
  setOptions

QWidget replaceExtension | ( |  | self ) |

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 replacement | ( |  | self ) |

Returns the replacement string.

QStringList replacementHistory | ( |  | self ) |

Returns the list of history items.

See also:
  setReplacementHistory

setOptions | ( | self, |
|  | long | options
| ) |  |  |

Set the options which are enabled.

Parameters:

  | options | The setting of the Options.

setReplacementHistory | ( | self, |
|  | 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.

Parameters:

  | history | The replacement history.

See also:
  replacementHistory

showEvent | ( | self, |
|  | QShowEvent | a0
| ) |  |  |

## Enumeration Documentation

Options

Enumerator:

  PromptOnReplace = 256 |
  BackReference = 512 |