Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QCompletionEngine Class Referenceabstract

#include <qcompleter_p.h>

+ Inheritance diagram for QCompletionEngine:
+ Collaboration diagram for QCompletionEngine:

Public Types

typedef QMap< QString, QMatchDataCacheItem
 
typedef QMap< QModelIndex, CacheItemCache
 

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
 
QCompleterPrivatec
 
QStringList curParts
 
QModelIndex curParent
 
int curRow
 
Cache cache
 
int cost
 

Detailed Description

Definition at line 111 of file qcompleter_p.h.

Member Typedef Documentation

◆ Cache

Definition at line 115 of file qcompleter_p.h.

◆ CacheItem

Definition at line 114 of file qcompleter_p.h.

Constructor & Destructor Documentation

◆ QCompletionEngine()

QCompletionEngine::QCompletionEngine ( QCompleterPrivate * c)
inline

Definition at line 117 of file qcompleter_p.h.

◆ ~QCompletionEngine()

virtual QCompletionEngine::~QCompletionEngine ( )
inlinevirtual

Definition at line 118 of file qcompleter_p.h.

Member Function Documentation

◆ filter() [1/2]

virtual QMatchData QCompletionEngine::filter ( const QString & ,
const QModelIndex & ,
int  )
pure virtual

◆ filter() [2/2]

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, and QSqlQueryModel::rowCount().

Referenced by QCompletionModel::filter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterHistory()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterOnDemand()

virtual void QCompletionEngine::filterOnDemand ( int )
inlinevirtual

Reimplemented in QUnsortedModelEngine.

Definition at line 128 of file qcompleter_p.h.

Referenced by QCompletionModel::completionCount(), QCompletionModel::index(), QCompletionModel::mapFromSource(), and QCompletionModel::setCurrentRow().

+ Here is the caller graph for this function:

◆ lookupCache()

bool QCompletionEngine::lookupCache ( const QString & part,
const QModelIndex & parent,
QMatchData * m ) const

Definition at line 487 of file qcompleter.cpp.

References cache, Qt::CaseInsensitive, QString::cs, QMap< Key, T >::end(), QMap< Key, T >::find(), QString::isEmpty(), it, map, and QString::toLower().

Referenced by QSortedModelEngine::filter(), and QUnsortedModelEngine::filter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ matchCount()

int QCompletionEngine::matchCount ( ) const
inline

Definition at line 131 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ matchHint()

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(), QString::cs, QMap< Key, T >::end(), QMap< Key, T >::find(), hint(), QString::isEmpty(), it, map, and QString::toLower().

Referenced by QSortedModelEngine::filter(), and QUnsortedModelEngine::filter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveInCache()

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, QMap< Key, T >::take(), QString::toLower(), and QMap< Key, T >::iterator::value().

Referenced by QSortedModelEngine::filter(), QUnsortedModelEngine::filter(), and QUnsortedModelEngine::filterOnDemand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ c

QCompleterPrivate* QCompletionEngine::c

Definition at line 134 of file qcompleter_p.h.

◆ cache

Cache QCompletionEngine::cache

◆ cost

int QCompletionEngine::cost

Definition at line 140 of file qcompleter_p.h.

Referenced by saveInCache().

◆ curMatch

◆ curParent

◆ curParts

◆ curRow

int QCompletionEngine::curRow

◆ historyMatch

QMatchData QCompletionEngine::historyMatch

The documentation for this class was generated from the following files: