![]() |
Qt 6.x
The Qt SDK
|
#include <qcompleter_p.h>
Public Types | |
typedef QMap< QString, QMatchData > | CacheItem |
typedef QMap< QModelIndex, CacheItem > | Cache |
Public Member Functions | |
QCompletionEngine (QCompleterPrivate *c) | |
virtual | ~QCompletionEngine () |
void | filter (const QStringList &parts) |
QMatchData | filterHistory () |
bool | matchHint (const QString &part, const QModelIndex &parent, QMatchData *m) const |
void | saveInCache (QString, const QModelIndex &, const QMatchData &) |
bool | lookupCache (const QString &part, const QModelIndex &parent, QMatchData *m) const |
virtual void | filterOnDemand (int) |
virtual QMatchData | filter (const QString &, const QModelIndex &, int)=0 |
int | matchCount () const |
Public Attributes | |
QMatchData | curMatch |
QMatchData | historyMatch |
QCompleterPrivate * | c |
QStringList | curParts |
QModelIndex | curParent |
int | curRow |
Cache | cache |
int | cost |
Definition at line 109 of file qcompleter_p.h.
typedef QMap<QModelIndex, CacheItem> QCompletionEngine::Cache |
Definition at line 113 of file qcompleter_p.h.
typedef QMap<QString, QMatchData> QCompletionEngine::CacheItem |
Definition at line 112 of file qcompleter_p.h.
|
inline |
Definition at line 115 of file qcompleter_p.h.
|
inlinevirtual |
Definition at line 116 of file qcompleter_p.h.
|
pure virtual |
Implemented in QSortedModelEngine, and QUnsortedModelEngine.
void QCompletionEngine::filter | ( | const QStringList & | parts | ) |
Definition at line 398 of file qcompleter.cpp.
References curMatch, curParent, curParts, curRow, filterHistory(), historyMatch, i, QAbstractTableModel::index(), QMatchData::isValid(), model, parent, and QSqlQueryModel::rowCount().
Referenced by QCompletionModel::filter().
QMatchData QCompletionEngine::filterHistory | ( | ) |
Definition at line 432 of file qcompleter.cpp.
References curParts, QString::data(), i, Q_UNUSED, QDir::separator(), QString::startsWith(), str, and QDir::toNativeSeparators().
Referenced by filter().
|
inlinevirtual |
Reimplemented in QUnsortedModelEngine.
Definition at line 126 of file qcompleter_p.h.
Referenced by QCompletionModel::completionCount(), QCompletionModel::index(), QCompletionModel::mapFromSource(), and QCompletionModel::setCurrentRow().
bool QCompletionEngine::lookupCache | ( | const QString & | part, |
const QModelIndex & | parent, | ||
QMatchData * | m | ||
) | const |
Definition at line 487 of file qcompleter.cpp.
References cache, Qt::CaseInsensitive, QMap< Key, T >::end(), QMap< Key, T >::find(), QString::isEmpty(), it, map, parent, and QString::toLower().
Referenced by QSortedModelEngine::filter(), and QUnsortedModelEngine::filter().
|
inline |
Definition at line 129 of file qcompleter_p.h.
References QIndexMapper::count(), curMatch, historyMatch, and QMatchData::indices.
Referenced by QCompleterPrivate::_q_complete(), QCompletionModel::completionCount(), QCompletionModel::currentIndex(), QUnsortedModelEngine::filterOnDemand(), QCompletionModel::hasChildren(), QCompletionModel::index(), QCompletionModel::mapFromSource(), QCompletionModel::mapToSource(), QCompletionModel::rowCount(), and QCompletionModel::setCurrentRow().
bool QCompletionEngine::matchHint | ( | const QString & | part, |
const QModelIndex & | parent, | ||
QMatchData * | m | ||
) | const |
Definition at line 461 of file qcompleter.cpp.
References cache, Qt::CaseInsensitive, QString::chop(), QMap< Key, T >::end(), QMap< Key, T >::find(), hint(), QString::isEmpty(), it, map, parent, and QString::toLower().
Referenced by QSortedModelEngine::filter(), and QUnsortedModelEngine::filter().
void QCompletionEngine::saveInCache | ( | QString | part, |
const QModelIndex & | parent, | ||
const QMatchData & | m | ||
) |
Definition at line 509 of file qcompleter.cpp.
References QMap< Key, T >::begin(), cache, Qt::CaseInsensitive, QIndexMapper::cost(), cost, QMap< Key, T >::end(), QMap< Key, T >::erase(), i, QMatchData::indices, Qt::MatchEndsWith, parent, QMap< Key, T >::size(), QMap< Key, T >::take(), QString::toLower(), and QMap< Key, T >::iterator::value().
Referenced by QSortedModelEngine::filter(), QUnsortedModelEngine::filter(), and QUnsortedModelEngine::filterOnDemand().
QCompleterPrivate* QCompletionEngine::c |
Definition at line 132 of file qcompleter_p.h.
Cache QCompletionEngine::cache |
Definition at line 137 of file qcompleter_p.h.
Referenced by QSortedModelEngine::indexHint(), QCompletionModel::invalidate(), lookupCache(), matchHint(), and saveInCache().
int QCompletionEngine::cost |
Definition at line 138 of file qcompleter_p.h.
Referenced by saveInCache().
QMatchData QCompletionEngine::curMatch |
Definition at line 131 of file qcompleter_p.h.
Referenced by QCompletionModel::currentIndex(), filter(), QUnsortedModelEngine::filterOnDemand(), QCompletionModel::mapFromSource(), QCompletionModel::mapToSource(), and matchCount().
QModelIndex QCompletionEngine::curParent |
Definition at line 134 of file qcompleter_p.h.
Referenced by filter(), QCompletionModel::filter(), QUnsortedModelEngine::filterOnDemand(), QCompletionModel::index(), QCompletionModel::mapFromSource(), QCompletionModel::mapToSource(), and QCompletionModel::rowCount().
QStringList QCompletionEngine::curParts |
Definition at line 133 of file qcompleter_p.h.
Referenced by filter(), filterHistory(), QUnsortedModelEngine::filterOnDemand(), QCompletionModel::invalidate(), and QCompletionModel::rowCount().
int QCompletionEngine::curRow |
Definition at line 135 of file qcompleter_p.h.
Referenced by QCompletionModel::currentIndex(), QCompletionModel::currentRow(), filter(), and QCompletionModel::setCurrentRow().
QMatchData QCompletionEngine::historyMatch |
Definition at line 131 of file qcompleter_p.h.
Referenced by filter(), QCompletionModel::index(), QCompletionModel::mapFromSource(), QCompletionModel::mapToSource(), and matchCount().