A search target (for KLFSearchBar) for standard item views. More...
#include <klfitemviewsearchtarget.h>
Public Member Functions | |
KLFItemViewSearchTarget (QAbstractItemView *view, QObject *parent=NULL) | |
virtual | ~KLFItemViewSearchTarget () |
QAbstractItemView * | view () |
QList< int > | searchColumns () |
virtual QModelIndex | searchIterAdvance (const QModelIndex &pos, bool forward) |
virtual QModelIndex | searchIterBegin () |
virtual QModelIndex | searchIterEnd () |
virtual bool | searchIterMatches (const QModelIndex &pos, const QString &queryString) |
virtual void | searchPerformed (const QModelIndex &resultMatchPosition, bool found, const QString &queryString) |
virtual void | searchAborted () |
virtual void | searchReinitialized () |
virtual void | searchMoveToIterPos (const QModelIndex &pos) |
void | setSearchView (QAbstractItemView *view) |
void | setSearchColumns (const QList< int > &columnList) |
![]() | |
QObject (QObject *parent) | |
virtual | ~QObject () |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
virtual const QMetaObject * | metaObject () const |
QString | objectName () const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const |
bool | isWindowType () const |
bool | signalsBlocked () const |
bool | blockSignals (bool block) |
QThread * | thread () const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const |
const QObjectList & | children () const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
bool | disconnect (const QObject *receiver, const char *method) const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const |
QList< QByteArray > | dynamicPropertyNames () const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const |
bool | inherits (const char *className) const |
void | deleteLater () |
![]() | |
KLFIteratorSearchable () | |
virtual | ~KLFIteratorSearchable () |
SearchIterator | searchIterNext (const SearchIterator &pos) |
SearchIterator | searchIterPrev (const SearchIterator &pos) |
virtual SearchIterator | searchIterStartFrom (bool forward) |
virtual void | searchPerformed (const SearchIterator &resultMatchPosition) |
virtual void | searchPerformed (const QString &queryString, bool found, const Pos &pos) |
virtual Pos | searchStartFrom (bool forward) |
virtual void | searchMoveToPos (const Pos &pos) |
virtual SearchIterator | searchIterFind (const SearchIterator &startPos, const QString &queryString, bool forward) |
Find occurence of a search string. More... | |
virtual SearchIterator | searchIterFindNext (bool forward) |
Find the next occurence of previous search string. More... | |
virtual Pos | searchFind (const QString &queryString, const Pos &fromPos, bool forward) |
SearchIterator | searchAdvanceIteratorSafe (const SearchIterator &it, int n=1) |
SearchIterator | searchAdvanceIteratorCycle (const SearchIterator &it, int n=1, bool skipEnd=false) |
![]() | |
virtual QString | searchQueryString () const |
The current query string. More... | |
virtual void | setSearchQueryString (const QString &s) |
virtual bool | searchHasInterruptRequested () |
virtual void | setSearchInterruptRequested (bool on) |
![]() | |
KLFTarget () | |
virtual | ~KLFTarget () |
Additional Inherited Members | |
![]() | |
typedef QModelIndex | SearchIterator |
![]() | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
![]() | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
![]() | |
SearchIterator | searchCurrentIterPos () const |
![]() | |
QList< KLFTargeter * > | pTargetOf |
![]() | |
objectName | |
A search target (for KLFSearchBar) for standard item views.
Add search functionality to standard item views. Any item view you may have (QTreeView/QListView etc.) may be added search functionality with KLFSearchBar, using this class as search target.
For basic usage, you should not need to interact more with this class than simply instantiating it and feeding it to KLFSearchBar as the search target with KLFSearchBar::setSearchTarget().
Matches are displayed in highlighted red font, and current found item is displayed as selected.
Minimal example:
Definition at line 60 of file klfitemviewsearchtarget.h.
KLFItemViewSearchTarget::KLFItemViewSearchTarget | ( | QAbstractItemView * | view, |
QObject * | parent = NULL |
||
) |
Definition at line 130 of file klfitemviewsearchtarget.cpp.
References KLF_INIT_PRIVATE, and setSearchView().
|
virtual |
Definition at line 136 of file klfitemviewsearchtarget.cpp.
References KLF_DELETE_PRIVATE.
|
virtual |
Reimplemented from KLFIteratorSearchable< QModelIndex >.
Definition at line 212 of file klfitemviewsearchtarget.cpp.
References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and KLFIteratorSearchable< Iter >::searchAborted().
QList< int > KLFItemViewSearchTarget::searchColumns | ( | ) |
Definition at line 146 of file klfitemviewsearchtarget.cpp.
|
virtual |
Implements KLFIteratorSearchable< QModelIndex >.
Definition at line 154 of file klfitemviewsearchtarget.cpp.
|
virtual |
Implements KLFIteratorSearchable< QModelIndex >.
Definition at line 161 of file klfitemviewsearchtarget.cpp.
|
virtual |
Implements KLFIteratorSearchable< QModelIndex >.
Definition at line 165 of file klfitemviewsearchtarget.cpp.
|
virtual |
Implements KLFIteratorSearchable< QModelIndex >.
Definition at line 169 of file klfitemviewsearchtarget.cpp.
References QModelIndex::data(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, QList::size(), and QVariant::toString().
|
virtual |
Reimplemented from KLFIteratorSearchable< QModelIndex >.
Definition at line 227 of file klfitemviewsearchtarget.cpp.
References KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, and KLF_FUNC_NAME.
|
virtual |
Reimplemented from KLFIteratorSearchable< QModelIndex >.
Definition at line 177 of file klfitemviewsearchtarget.cpp.
References KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, and KLF_FUNC_NAME.
|
virtual |
Reimplemented from KLFPosSearchable.
Definition at line 219 of file klfitemviewsearchtarget.cpp.
References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and KLFPosSearchable::searchReinitialized().
void KLFItemViewSearchTarget::setSearchColumns | ( | const QList< int > & | columnList | ) |
Definition at line 248 of file klfitemviewsearchtarget.cpp.
References QAbstractItemModel::columnCount(), KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and QList::toSet().
Referenced by setSearchView().
void KLFItemViewSearchTarget::setSearchView | ( | QAbstractItemView * | view | ) |
Definition at line 236 of file klfitemviewsearchtarget.cpp.
References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, setSearchColumns(), and view().
Referenced by KLFItemViewSearchTarget().
QAbstractItemView * KLFItemViewSearchTarget::view | ( | ) |
Definition at line 142 of file klfitemviewsearchtarget.cpp.
Referenced by setSearchView().