A completer model that can present its rows bottom-to-top.
More...
#include <reversed_completer_model.h>
|
| void | setSourceModel (QAbstractItemModel *sourceModel) override |
| void | setEnabled (bool enabled) |
| QModelIndex | mapToSource (const QModelIndex &proxyIndex) const override |
| QModelIndex | mapFromSource (const QModelIndex &sourceIndex) const override |
| QModelIndex | index (int row, int column, const QModelIndex &parent={}) const override |
| QModelIndex | parent (const QModelIndex &) const override |
| int | rowCount (const QModelIndex &parent={}) const override |
| int | columnCount (const QModelIndex &parent={}) const override |
| QVariant | data (const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const override |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
A completer model that can present its rows bottom-to-top.
The original row order is kept intact in the source model (row 0 is always the closest match). When enabled, the proxy maps the source rows in reverse so the popup shows the closest match in the row nearest to the text edit. Any change in the source model is forwarded as a full reset, which is all QCompleter needs to rebuild its completion list.
◆ columnCount()
| int ReversedCompleterModel::columnCount |
( |
const QModelIndex & | parent = {} | ) |
const |
|
override |
◆ data()
| QVariant ReversedCompleterModel::data |
( |
const QModelIndex & | proxyIndex, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
◆ headerData()
| QVariant ReversedCompleterModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
◆ index()
| QModelIndex ReversedCompleterModel::index |
( |
int | row, |
|
|
int | column, |
|
|
const QModelIndex & | parent = {} ) const |
|
override |
◆ invalidate()
| void ReversedCompleterModel::invalidate |
( |
| ) |
|
|
private |
◆ mapFromSource()
| QModelIndex ReversedCompleterModel::mapFromSource |
( |
const QModelIndex & | sourceIndex | ) |
const |
|
override |
◆ mapToSource()
| QModelIndex ReversedCompleterModel::mapToSource |
( |
const QModelIndex & | proxyIndex | ) |
const |
|
override |
◆ parent()
| QModelIndex ReversedCompleterModel::parent |
( |
const QModelIndex & | | ) |
const |
|
override |
◆ rowCount()
| int ReversedCompleterModel::rowCount |
( |
const QModelIndex & | parent = {} | ) |
const |
|
override |
◆ setEnabled()
| void ReversedCompleterModel::setEnabled |
( |
bool | enabled | ) |
|
◆ setSourceModel()
| void ReversedCompleterModel::setSourceModel |
( |
QAbstractItemModel * | sourceModel | ) |
|
|
override |
◆ sourceRowCount()
| int ReversedCompleterModel::sourceRowCount |
( |
| ) |
const |
|
private |
◆ isEnabled
| bool ReversedCompleterModel::isEnabled = false |
|
private |
The documentation for this class was generated from the following files: