A QTreeView class based searcher. More...
#include <QtxSearchTool.h>
Public Member Functions | |
QtxTreeViewSearcher (QTreeView *, int=0) | |
Constructor. More... | |
virtual | ~QtxTreeViewSearcher () |
Destructor. More... | |
int | searchColumn () const |
Get column for which search is performed. More... | |
void | setSearchColumn (int) |
Set column for which search should be performed. More... | |
virtual bool | find (const QString &, QtxSearchTool *) |
Start new search. More... | |
virtual bool | findNext (const QString &, QtxSearchTool *) |
Search next appropriate item. More... | |
virtual bool | findPrevious (const QString &, QtxSearchTool *) |
Search previous appropriate item. More... | |
virtual bool | findFirst (const QString &, QtxSearchTool *) |
Search first appropriate item. More... | |
virtual bool | findLast (const QString &, QtxSearchTool *) |
Search last appropriate item. More... | |
Public Member Functions inherited from QtxSearchTool::Searcher | |
Searcher () | |
Constructor. More... | |
virtual | ~Searcher () |
Destructor. More... | |
Protected Member Functions | |
virtual Qt::MatchFlags | matchFlags (QtxSearchTool *) const |
Get match flags to be used by the searcher. More... | |
Private Member Functions | |
QModelIndexList | findItems (const QString &, QtxSearchTool *) |
Find all appropriate items. More... | |
QModelIndex | findNearest (const QModelIndex &, const QModelIndexList &, bool) |
Find model index from the list nearest to the specified index. More... | |
void | showItem (const QModelIndex &) |
Ensure the found item to become visible and selected. More... | |
QString | getId (const QModelIndex &) |
Get unique item ID. More... | |
int | compareIndices (const QModelIndex &, const QModelIndex &) |
Compare items. More... | |
Private Attributes | |
QTreeView * | myView |
int | myColumn |
QPersistentModelIndex | myIndex |
The class QtxTreeViewSearcher can be used to find the items in the QTreeView widget.
The column for which data should be searched can be get/set with the searchColumn(), setSearchColumn() methods. By default, column 0 is used.
QtxTreeViewSearcher::QtxTreeViewSearcher | ( | QTreeView * | view, |
int | col = 0 |
||
) |
view | tree view widget |
col | column for which search to be performed (0 by default) |
|
virtual |
|
private |
left | first model index to be compared |
right | last model index to be compared |
References getId().
|
virtual |
text | text to be found |
st | search tool widget |
Implements QtxSearchTool::Searcher.
References findItems(), findNearest(), QtxSearchTool::isSearchWrapped(), myView, and showItem().
|
virtual |
text | text to be found |
st | search tool widget |
Implements QtxSearchTool::Searcher.
References findItems(), and showItem().
|
private |
text | text to be found |
st | search tool widget |
References matchFlags(), myColumn, myView, and s.
|
virtual |
text | text to be found |
st | search tool widget |
Implements QtxSearchTool::Searcher.
References findItems(), and showItem().
|
private |
index | model index for which a nearest item is searched |
lst | list of model indices |
direction | if true find next appropriate item, otherwise find privious appropriate item |
References compareIndices().
|
virtual |
text | text to be found |
st | search tool widget |
Implements QtxSearchTool::Searcher.
References findItems(), findNearest(), QtxSearchTool::isSearchWrapped(), myIndex, myView, and showItem().
|
virtual |
text | text to be found |
st | search tool widget |
Implements QtxSearchTool::Searcher.
References findItems(), findNearest(), QtxSearchTool::isSearchWrapped(), myIndex, myView, and showItem().
|
private |
index | model index |
|
protectedvirtual |
st | search tool widget |
References QtxSearchTool::isCaseSensitive(), and QtxSearchTool::isRegExpSearch().
int QtxTreeViewSearcher::searchColumn | ( | ) | const |
void QtxTreeViewSearcher::setSearchColumn | ( | int | column | ) |
|
private |
|
private |
|
private |
|
private |