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

KDEUI

Signals | Public Member Functions | Protected Member Functions | List of all members
KFindDialog Class Reference

#include <kfinddialog.h>

Inheritance diagram for KFindDialog:
Inheritance graph
[legend]

Signals

void optionsChanged ()
 
- Signals inherited from KDialog
void aboutToShowDetails ()
 
void applyClicked ()
 
void buttonClicked (KDialog::ButtonCode button)
 
void cancelClicked ()
 
void closeClicked ()
 
void defaultClicked ()
 
void finished ()
 
void helpClicked ()
 
void hidden ()
 
void layoutHintChanged ()
 
void noClicked ()
 
void okClicked ()
 
void resetClicked ()
 
void tryClicked ()
 
void user1Clicked ()
 
void user2Clicked ()
 
void user3Clicked ()
 
void yesClicked ()
 

Public Member Functions

 KFindDialog (QWidget *parent=0, long options=0, const QStringList &findStrings=QStringList(), bool hasSelection=false, bool replaceDialog=false)
 
virtual ~KFindDialog ()
 
QWidget * findExtension () const
 
QStringList findHistory () const
 
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)
 
- Public Member Functions inherited from KDialog
 KDialog (QWidget *parent=0, Qt::WindowFlags flags=0)
 
 ~KDialog ()
 
KPushButton * button (ButtonCode id) const
 
KIcon buttonIcon (ButtonCode id) const
 
QString buttonText (ButtonCode id) const
 
QString buttonToolTip (ButtonCode id) const
 
QString buttonWhatsThis (ButtonCode id) const
 
ButtonCode defaultButton () const
 
QString helpLinkText () const
 
void incrementInitialSize (const QSize &size)
 
bool isButtonEnabled (ButtonCode id) const
 
QWidget * mainWidget ()
 
virtual QSize minimumSizeHint () const
 
void restoreDialogSize (const KConfigGroup &config)
 
void saveDialogSize (KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) const
 
void setButtonFocus (ButtonCode id)
 
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
 
void setButtonIcon (ButtonCode id, const KIcon &icon)
 
void setButtonMenu (ButtonCode id, QMenu *menu, ButtonPopupMode popupmode=InstantPopup)
 
void setButtons (ButtonCodes buttonMask)
 
void setButtonsOrientation (Qt::Orientation orientation)
 
void setButtonText (ButtonCode id, const QString &text)
 
void setButtonToolTip (ButtonCode id, const QString &text)
 
void setButtonWhatsThis (ButtonCode id, const QString &text)
 
void setDefaultButton (ButtonCode id)
 
void setEscapeButton (ButtonCode id)
 
void setInitialSize (const QSize &size)
 
void setMainWidget (QWidget *widget)
 
void showButton (ButtonCode id, bool state)
 
void showButtonSeparator (bool state)
 
virtual QSize sizeHint () const
 

Protected Member Functions

virtual void showEvent (QShowEvent *)
 
- Protected Member Functions inherited from KDialog
 KDialog (KDialogPrivate &dd, QWidget *parent, Qt::WindowFlags flags=0)
 
virtual void closeEvent (QCloseEvent *e)
 
virtual void hideEvent (QHideEvent *)
 
virtual void keyPressEvent (QKeyEvent *)
 

Additional Inherited Members

- Public Types inherited from KDialog
enum  ButtonCode {
  None = 0x00000000, Help = 0x00000001, Default = 0x00000002, Ok = 0x00000004,
  Apply = 0x00000008, Try = 0x00000010, Cancel = 0x00000020, Close = 0x00000040,
  No = 0x00000080, Yes = 0x00000100, Reset = 0x00000200, Details = 0x00000400,
  User1 = 0x00001000, User2 = 0x00002000, User3 = 0x00004000, NoDefault = 0x00008000
}
 
enum  ButtonPopupMode { InstantPopup = 0, DelayedPopup = 1 }
 
enum  CaptionFlag { NoCaptionFlags = 0, AppNameCaption = 1, ModifiedCaption = 2, HIGCompliantCaption = AppNameCaption }
 
- Public Slots inherited from KDialog
void delayedDestruct ()
 
void enableButton (ButtonCode id, bool state)
 
void enableButtonApply (bool state)
 
void enableButtonCancel (bool state)
 
void enableButtonOk (bool state)
 
void enableLinkedHelp (bool state)
 
bool isDetailsWidgetVisible () const
 
virtual void setCaption (const QString &caption)
 
virtual void setCaption (const QString &caption, bool modified)
 
void setDetailsWidget (QWidget *detailsWidget)
 
void setDetailsWidgetVisible (bool visible)
 
void setHelp (const QString &anchor, const QString &appname=QString())
 
void setHelpLinkText (const QString &text)
 
virtual void setPlainCaption (const QString &caption)
 
- Static Public Member Functions inherited from KDialog
static bool avoidArea (QWidget *widget, const QRect &area, int screen=-1)
 
static void centerOnScreen (QWidget *widget, int screen=-1)
 
static int groupSpacingHint ()
 
static QString makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
 
static int marginHint ()
 
static void resizeLayout (QWidget *widget, int margin, int spacing)
 
static void resizeLayout (QLayout *lay, int margin, int spacing)
 
static void setAllowEmbeddingInGraphicsView (bool allowEmbedding)
 
static int spacingHint ()
 
- Protected Slots inherited from KDialog
virtual void slotButtonClicked (int button)
 
void updateGeometry ()
 
- Protected Attributes inherited from KDialog
KDialogPrivate *const d_ptr
 

Detailed Description

A generic "find" dialog.

Author
S.R.Haque srhaq.nosp@m.ue@i.nosp@m.ee.or.nosp@m.g

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".)

Note
If using a non-modal find dialog, in the slot connected to the okClicked() signal you need to check if a regular expression has been entered and if so, whether it is valid. Otherwise, if it is invalid, the user will see an error message followed unexpectedly by a search taking place.
if ( (m_findDia->options() & KFind::RegularExpression)
&& !QRegExp(m_findDia->pattern()).isValid() )
{
// Don't attempt to search
}

To use your own extensions: see findExtension().

kfinddialog.png
KDE Find Dialog

Definition at line 78 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
parentThe parent object of this widget.
optionsA bitfield of the Options to be checked.
findStringsThe find history, see findHistory()
hasSelectionWhether 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

Definition at line 281 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 300 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
historyThe find history.
See also
findHistory

Definition at line 313 of file kfinddialog.cpp.

void KFindDialog::setHasCursor ( bool  hasCursor)

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

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

Definition at line 345 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
hasSelectiontrue if a selection exists

Definition at line 325 of file kfinddialog.cpp.

void KFindDialog::setOptions ( long  options)

Set the options which are checked.

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

Definition at line 398 of file kfinddialog.cpp.

void KFindDialog::setPattern ( const QString &  pattern)

Sets the pattern to find.

Definition at line 305 of file kfinddialog.cpp.

void KFindDialog::setSupportsBackwardsFind ( bool  supports)

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

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

Definition at line 353 of file kfinddialog.cpp.

void KFindDialog::setSupportsCaseSensitiveFind ( bool  supports)

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

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

Definition at line 362 of file kfinddialog.cpp.

void KFindDialog::setSupportsRegularExpressionFind ( bool  supports)

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

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

Definition at line 380 of file kfinddialog.cpp.

void KFindDialog::setSupportsWholeWordsFind ( bool  supports)

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

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

Definition at line 371 of file kfinddialog.cpp.

void KFindDialog::showEvent ( QShowEvent *  e)
protectedvirtual

Reimplemented in KReplaceDialog.

Definition at line 254 of file kfinddialog.cpp.


The documentation for this class was generated from the following files:
  • kfinddialog.h
  • kfinddialog.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal