Konsole
#include <IncrementalSearchBar.h>
Public Types | |
enum | SearchOptions { HighlightMatches = 0, MatchCase = 1, RegExp = 2, ReverseSearch = 3 } |
Public Slots | |
void | clearLineEdit () |
Signals | |
void | closeClicked () |
void | findNextClicked () |
void | findPreviousClicked () |
void | highlightMatchesToggled (bool) |
void | matchCaseToggled (bool) |
void | matchRegExpToggled (bool) |
void | searchChanged (const QString &text) |
void | searchFromClicked () |
void | searchReturnPressed (const QString &text) |
void | searchShiftPlusReturnPressed () |
void | unhandledMovementKeyPressed (QKeyEvent *event) |
Public Member Functions | |
IncrementalSearchBar (QWidget *parent=0) | |
void | focusLineEdit () |
const QBitArray | optionsChecked () |
QString | searchText () |
void | setFoundMatch (bool match) |
void | setSearchText (const QString &text) |
virtual void | setVisible (bool visible) |
Protected Member Functions | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
Detailed Description
A widget which allows users to search incrementally through a document for a a text string or regular expression.
The widget consists of a text box into which the user can enter their search text and buttons to trigger a search for the next and previous matches for the search text.
When the search text is changed, the searchChanged() signal is emitted. A search through the document for the new text should begin immediately and the active view of the document should jump to display any matches if found. setFoundMatch() should be called whenever the search text changes to indicate whether a match for the text was found in the document.
findNextClicked() and findPreviousClicked() signals are emitted when the user presses buttons to find next and previous matches respectively.
The first indicates whether searches are case sensitive. The matchCaseToggled() signal is emitted when this is changed. The second indicates whether the search text should be treated as a plain string or as a regular expression. The matchRegExpToggled() signal is emitted when this is changed.
Definition at line 56 of file IncrementalSearchBar.h.
Member Enumeration Documentation
This enum defines the options that can be checked.
Enumerator | |
---|---|
HighlightMatches |
Highlight all matches. |
MatchCase |
Searches are case-sensitive or not. |
RegExp |
Searches use regular expressions. |
ReverseSearch |
Search from the bottom and up. |
Definition at line 64 of file IncrementalSearchBar.h.
Constructor & Destructor Documentation
|
explicit |
Constructs a new incremental search bar with the given parent widget.
Definition at line 39 of file IncrementalSearchBar.cpp.
Member Function Documentation
|
slot |
Definition at line 263 of file IncrementalSearchBar.cpp.
|
signal |
Emitted when the close button is clicked.
|
protectedvirtual |
Definition at line 186 of file IncrementalSearchBar.cpp.
|
signal |
Emitted when the user clicks the button to find the next match.
|
signal |
Emitted when the user clicks the button to find the previous match.
void IncrementalSearchBar::focusLineEdit | ( | ) |
Definition at line 268 of file IncrementalSearchBar.cpp.
|
signal |
Emitted when the user toggles the checkbox to indicate whether matches for the search text should be highlighted.
|
protectedvirtual |
Definition at line 217 of file IncrementalSearchBar.cpp.
|
signal |
Emitted when the user toggles the checkbox to indicate whether matching for the search text should be case sensitive.
|
signal |
Emitted when the user toggles the checkbox to indicate whether the search text should be treated as a plain string or a regular expression.
const QBitArray IncrementalSearchBar::optionsChecked | ( | ) |
Definition at line 274 of file IncrementalSearchBar.cpp.
|
signal |
Emitted when the text entered in the search box is altered.
|
signal |
The search from beginning/end button.
|
signal |
Emitted when the return button is pressed in the search box.
|
signal |
Emitted when shift+return buttons are pressed in the search box.
QString IncrementalSearchBar::searchText | ( | ) |
Returns the current search text.
Definition at line 175 of file IncrementalSearchBar.cpp.
void IncrementalSearchBar::setFoundMatch | ( | bool | match | ) |
Sets an indicator for the user as to whether or not a match for the current search text was found in the document.
The indicator will not be shown if the search text is empty ( because the user has not yet entered a query ).
- Parameters
-
match True if a match was found or false otherwise. If true, and the search text is non-empty, an indicator that no matches were found will be shown.
Definition at line 242 of file IncrementalSearchBar.cpp.
void IncrementalSearchBar::setSearchText | ( | const QString & | text | ) |
Definition at line 180 of file IncrementalSearchBar.cpp.
|
virtual |
Definition at line 233 of file IncrementalSearchBar.cpp.
|
signal |
A movement key not handled is forwarded to the terminal display.
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:31:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.