KDEUI
#include <kfinddialog.h>
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 () |
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.
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:
To create a non-modal find dialog:
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().
Definition at line 78 of file kfinddialog.h.
Constructor & Destructor Documentation
|
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.
|
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.
|
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
-
history The 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
-
hasCursor true 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
-
hasSelection true if a selection exists
Definition at line 325 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
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
-
supports true 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
-
supports true 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
-
supports true 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
-
supports true 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.
|
protectedvirtual |
Reimplemented in KReplaceDialog.
Definition at line 254 of file kfinddialog.cpp.
The documentation for this class was generated from the following files:
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.