• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KFindDialog Class Reference

A generic "find" dialog. More...

#include <kfinddialog.h>

Inheritance diagram for KFindDialog:

Inheritance graph
[legend]

List of all members.


Signals

void optionsChanged ()

Public Member Functions

QWidget * findExtension () const
QStringList findHistory () const
 KFindDialog (QWidget *parent=0, long options=0, const QStringList &findStrings=QStringList(), bool hasSelection=false, bool replaceDialog=false)
long options () const
QString pattern () const
void setFindHistory (const QStringList &history)
void setHasCursor (bool hasCursor)
void setHasSelection (bool hasSelection)
void setOptions (long options)
void setPattern (const QString &pattern)
void setSupportsBackwardsFind (bool supports)
void setSupportsCaseSensitiveFind (bool supports)
void setSupportsRegularExpressionFind (bool supports)
void setSupportsWholeWordsFind (bool supports)
virtual ~KFindDialog ()

Protected Member Functions

virtual void showEvent (QShowEvent *)

Detailed Description

A generic "find" dialog.

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

This widget inherits from KDialog and implements the following additional functionalities: a find string object and an area for a user-defined widget to extend the dialog.

Example:

To use the basic modal find dialog, and then run the search:

  KFindDialog dlg(....)
  if ( dlg.exec() != QDialog::Accepted )
      return;

  // proceed with KFind from here

To create a non-modal find dialog:

   if ( m_findDia )
     KWindowSystem::activateWindow( m_findDia->winId() );
   else
   {
     m_findDia = new KFindDialog(false,...);
     connect( m_findDia, SIGNAL(okClicked()), this, SLOT(findTextNext()) );
   }
Don't forget to delete and reset m_findDia when closed. (But do NOT delete your KFind object at that point, it's needed for "Find Next")

To use your own extensions: see findExtension().

Definition at line 65 of file kfinddialog.h.


Constructor & Destructor Documentation

KFindDialog::KFindDialog ( QWidget *  parent = 0,
long  options = 0,
const QStringList &  findStrings = QStringList(),
bool  hasSelection = false,
bool  replaceDialog = false 
) [explicit]

Construct a modal find dialog.

Parameters:
parent The parent object of this widget.
options A bitfield of the Options to be checked.
findStrings The find history, see findHistory()
hasSelection Whether a selection exists

Definition at line 43 of file kfinddialog.cpp.

KFindDialog::~KFindDialog (  )  [virtual]

Destructor.

Definition at line 56 of file kfinddialog.cpp.


Member Function Documentation

QWidget * KFindDialog::findExtension (  )  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 below the regular expression support widgets for the pattern string.

Definition at line 61 of file kfinddialog.cpp.

QStringList KFindDialog::findHistory (  )  const

Returns the list of history items.

See also:
setFindHistory

Definition at line 72 of file kfinddialog.cpp.

long KFindDialog::options (  )  const

Returns the state of the options.

Disabled options may be returned in an indeterminate state.

See also:
setOptions()

KFind::Options

Reimplemented in KReplaceDialog.

Definition at line 275 of file kfinddialog.cpp.

void KFindDialog::optionsChanged (  )  [signal]

This signal is sent whenever one of the option checkboxes is toggled.

Call options() to get the new state of the checkboxes.

QString KFindDialog::pattern (  )  const

Returns the pattern to find.

Definition at line 294 of file kfinddialog.cpp.

void KFindDialog::setFindHistory ( const QStringList &  history  ) 

Provide the list of strings to be displayed as the history of find strings.

strings might get truncated if it is too long.

Parameters:
history The find history.
See also:
findHistory

Definition at line 307 of file kfinddialog.cpp.

void KFindDialog::setHasCursor ( bool  hasCursor  ) 

Hide/show the 'from cursor' option, depending on whether the application implements a cursor.

Parameters:
hasCursor true if the application features a cursor This is assumed to be the case by default.

Definition at line 339 of file kfinddialog.cpp.

void KFindDialog::setHasSelection ( bool  hasSelection  ) 

Enable/disable the 'search in selection' option, depending on whether there actually is a selection.

Parameters:
hasSelection true if a selection exists

Definition at line 319 of file kfinddialog.cpp.

void KFindDialog::setOptions ( long  options  ) 

Set the options which are checked.

Parameters:
options The setting of the Options.
See also:
options()

KFind::Options

Reimplemented in KReplaceDialog.

Definition at line 392 of file kfinddialog.cpp.

void KFindDialog::setPattern ( const QString &  pattern  ) 

Sets the pattern to find.

Definition at line 299 of file kfinddialog.cpp.

void KFindDialog::setSupportsBackwardsFind ( bool  supports  ) 

Enable/disable the 'Find backwards' option, depending on whether the application supports it.

Parameters:
supports true if the application supports backwards find This is assumed to be the case by default.

Definition at line 347 of file kfinddialog.cpp.

void KFindDialog::setSupportsCaseSensitiveFind ( bool  supports  ) 

Enable/disable the 'Case sensitive' option, depending on whether the application supports it.

Parameters:
supports true if the application supports case sensitive find This is assumed to be the case by default.

Definition at line 356 of file kfinddialog.cpp.

void KFindDialog::setSupportsRegularExpressionFind ( bool  supports  ) 

Enable/disable the 'Regular expression' option, depending on whether the application supports it.

Parameters:
supports true if the application supports regular expression find This is assumed to be the case by default.

Definition at line 374 of file kfinddialog.cpp.

void KFindDialog::setSupportsWholeWordsFind ( bool  supports  ) 

Enable/disable the 'Whole words only' option, depending on whether the application supports it.

Parameters:
supports true if the application supports whole words only find This is assumed to be the case by default.

Definition at line 365 of file kfinddialog.cpp.

void KFindDialog::showEvent ( QShowEvent *  e  )  [protected, virtual]

Reimplemented in KReplaceDialog.

Definition at line 257 of file kfinddialog.cpp.


The documentation for this class was generated from the following files:
  • kfinddialog.h
  • kfinddialog.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal