Skip to content

PythonQt.QtGui.QCompleter · declarations 001

Back to PythonQt.QtGui.QCompleter

CaseInsensitivelySortedModel instance-attribute

CaseInsensitivelySortedModel: Any

CaseSensitivelySortedModel instance-attribute

CaseSensitivelySortedModel: Any

CompletionMode instance-attribute

CompletionMode: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

InlineCompletion instance-attribute

InlineCompletion: Any

ModelSorting instance-attribute

ModelSorting: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

PopupCompletion instance-attribute

PopupCompletion: Any

UnfilteredPopupCompletion instance-attribute

UnfilteredPopupCompletion: Any

UnsortedModel instance-attribute

UnsortedModel: Any

activated

activated(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QCompleter.activated; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QCompleter::activated(const QModelIndex \&index)

This signal is sent when an item in the popup() is activated by the user. (by clicking or pressing return). The item's index in the completionModel() is given.

Note: Signal activated is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

connect(completer, QOverload<const QModelIndex &>::of(&QCompleter::activated),
    [=](const QModelIndex &index){ /* ... */ });

[signal] void QCompleter::activated(const QString \&text)

This signal is sent when an item in the popup() is activated by the user (by clicking or pressing return). The item's text is given.

Note: Signal activated is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

connect(completer, QOverload<const QString &>::of(&QCompleter::activated),
    [=](const QString &text){ /* ... */ });

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#activated

caseSensitivity instance-attribute

caseSensitivity: Any

Qt 5 reference:

caseSensitivity : Qt::CaseSensitivity

This property holds the case sensitivity of the matching

The default value is Qt::CaseSensitive.

Access functions:

Qt::CaseSensitivity caseSensitivity() const
void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)

See also completionColumn, completionRole, modelSorting, and filterMode.

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#caseSensitivity

complete

complete(rect: Any) -> None

X.complete(rect)

Supplemental documentation: Qt 5 reference:

[slot] void QCompleter::complete(const QRect \&rect \= QRect())

For QCompleter::PopupCompletion and QCompletion::UnfilteredPopupCompletion modes, calling this function displays the popup displaying the current completions. By default, if rect is not specified, the popup is displayed on the bottom of the widget(). If rect is specified the popup is displayed on the left edge of the rectangle.

For QCompleter::InlineCompletion mode, the highlighted() signal is fired with the current completion.

Upstream PySide2 reference signatures (binding differences may apply):

complete(self, rect: PySide2.QtCore.QRect=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#complete

completionColumn instance-attribute

completionColumn: int

Qt 5 reference:

completionColumn : int

This property holds the column in the model in which completions are searched for.

If the popup() is a QListView, it is automatically setup to display this column.

By default, the match column is 0.

Access functions:

int completionColumn() const
void setCompletionColumn(int column)

See also completionRole and caseSensitivity.

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#completionColumn

completionCount

completionCount() -> int

X.completionCount() -> int

Supplemental documentation: Qt 5 reference:

int QCompleter::completionCount() const

Returns the number of completions for the current prefix. For an unsorted model with a large number of items this can be expensive. Use setCurrentRow() and currentCompletion() to iterate through all the completions.

Upstream PySide2 reference signatures (binding differences may apply):

completionCount(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#completionCount

completionMode instance-attribute

completionMode: Any

Qt 5 reference:

completionMode : CompletionMode

how the completions are provided to the user

The default value is QCompleter::PopupCompletion.

Access functions:

QCompleter::CompletionMode completionMode() const
void setCompletionMode(QCompleter::CompletionMode mode)

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#completionMode

completionModel

completionModel() -> Any

X.completionModel() -> PythonQt.QtCore.QAbstractItemModel

Supplemental documentation: Qt 5 reference:

QAbstractItemModel *QCompleter::completionModel() const

Returns the completion model. The completion model is a read-only list model that contains all the possible matches for the current completion prefix. The completion model is auto-updated to reflect the current completions.

Note: The return value of this function is defined to be an QAbstractItemModel purely for generality. This actual kind of model returned is an instance of an QAbstractProxyModel subclass.

See also completionPrefix and model().

Upstream PySide2 reference signatures (binding differences may apply):

completionModel(self) -> PySide2.QtCore.QAbstractItemModel

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#completionModel

completionPrefix instance-attribute

completionPrefix: str

Qt 5 reference:

completionPrefix : QString

This property holds the completion prefix used to provide completions.

The completionModel() is updated to reflect the list of possible matches for prefix.

Access functions:

QString completionPrefix() const
void setCompletionPrefix(const QString \&prefix)

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#completionPrefix

completionRole instance-attribute

completionRole: int

Qt 5 reference:

completionRole : int

This property holds the item role to be used to query the contents of items for matching.

The default role is Qt::EditRole.

Access functions:

int completionRole() const
void setCompletionRole(int role)

See also completionColumn and caseSensitivity.

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#completionRole

currentCompletion

currentCompletion() -> str

X.currentCompletion() -> str

Supplemental documentation: Qt 5 reference:

QString QCompleter::currentCompletion() const

Returns the current completion string. This includes the completionPrefix. When used alongside setCurrentRow(), it can be used to iterate through all the matches.

See also setCurrentRow() and currentIndex().

Upstream PySide2 reference signatures (binding differences may apply):

currentCompletion(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#currentCompletion

currentIndex

currentIndex() -> Any

X.currentIndex() -> PythonQt.QtCore.QModelIndex

Supplemental documentation: Qt 5 reference:

QModelIndex QCompleter::currentIndex() const

Returns the model index of the current completion in the completionModel().

See also setCurrentRow(), currentCompletion(), and model().

Upstream PySide2 reference signatures (binding differences may apply):

currentIndex(self) -> PySide2.QtCore.QModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#currentIndex

currentRow

currentRow() -> int

X.currentRow() -> int

Supplemental documentation: Qt 5 reference:

int QCompleter::currentRow() const

Returns the current row.

See also setCurrentRow().

Upstream PySide2 reference signatures (binding differences may apply):

currentRow(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#currentRow

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QCompleter.destroyed; argument details are not documented.

event

event(arg__1: Any) -> bool

X.event(arg__1) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QCompleter::event(QEvent *ev)

Reimplements: QObject::event(QEvent *e).

Upstream PySide2 reference signatures (binding differences may apply):

event(self, arg__1: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#event

eventFilter

eventFilter(o: Any, e: Any) -> bool

X.eventFilter(o, e) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QCompleter::eventFilter(QObject *o, QEvent *e)

Reimplements: QObject::eventFilter(QObject *watched, QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

eventFilter(self, o: PySide2.QtCore.QObject, e: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#eventFilter

filterMode instance-attribute

filterMode: Any

Qt 5 reference:

filterMode : Qt::MatchFlags

This property controls how filtering is performed.

If filterMode is set to Qt::MatchStartsWith, only those entries that start with the typed characters will be displayed. Qt::MatchContains will display the entries that contain the typed characters, and Qt::MatchEndsWith the ones that end with the typed characters.

Setting filterMode to any other Qt::MatchFlag will issue a warning, and no action will be performed. Because of this, the Qt::MatchCaseSensitive flag has no effect. Use the caseSensitivity property to control case sensitivity.

The default mode is Qt::MatchStartsWith.

This property was introduced in Qt 5.2.

Access functions:

Qt::MatchFlags filterMode() const
void setFilterMode(Qt::MatchFlags filterMode)

See also caseSensitivity.

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#filterMode

highlighted

highlighted(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QCompleter.highlighted; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QCompleter::highlighted(const QModelIndex \&index)

This signal is sent when an item in the popup() is highlighted by the user. It is also sent if complete() is called with the completionMode() set to QCompleter::InlineCompletion. The item's index in the completionModel() is given.

Note: Signal highlighted is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

connect(completer, QOverload<const QModelIndex &>::of(&QCompleter::highlighted),
    [=](const QModelIndex &index){ /* ... */ });

[signal] void QCompleter::highlighted(const QString \&text)

This signal is sent when an item in the popup() is highlighted by the user. It is also sent if complete() is called with the completionMode() set to QCompleter::InlineCompletion. The item's text is given.

Note: Signal highlighted is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

connect(completer, QOverload<const QString &>::of(&QCompleter::highlighted),
    [=](const QString &text){ /* ... */ });

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#highlighted

maxVisibleItems instance-attribute

maxVisibleItems: int

Qt 5 reference:

maxVisibleItems : int

This property holds the maximum allowed size on screen of the completer, measured in items

By default, this property has a value of 7.

This property was introduced in Qt 4.6.

Access functions:

int maxVisibleItems() const
void setMaxVisibleItems(int maxItems)

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#maxVisibleItems

model

model() -> Any

X.model() -> PythonQt.QtCore.QAbstractItemModel

Supplemental documentation: Qt 5 reference:

QAbstractItemModel *QCompleter::model() const

Returns the model that provides completion strings.

See also setModel() and completionModel().

Upstream PySide2 reference signatures (binding differences may apply):

model(self) -> PySide2.QtCore.QAbstractItemModel

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#model

modelSorting instance-attribute

modelSorting: Any

Qt 5 reference:

modelSorting : ModelSorting

This property holds the way the model is sorted

By default, no assumptions are made about the order of the items in the model that provides the completions.

If the model's data for the completionColumn() and completionRole() is sorted in ascending order, you can set this property to CaseSensitivelySortedModel or CaseInsensitivelySortedModel. On large models, this can lead to significant performance improvements because the completer object can then use a binary search algorithm instead of linear search algorithm.

The sort order (i.e ascending or descending order) of the model is determined dynamically by inspecting the contents of the model.

Note: The performance improvements described above cannot take place when the completer's caseSensitivity is different to the case sensitivity used by the model's when sorting.

Access functions:

QCompleter::ModelSorting modelSorting() const
void setModelSorting(QCompleter::ModelSorting sorting)

See also setCaseSensitivity() and QCompleter::ModelSorting.

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#modelSorting

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QCompleter.objectNameChanged; argument details are not documented.

pathFromIndex

pathFromIndex(index: Any) -> str

X.pathFromIndex(index) -> str

Supplemental documentation: Qt 5 reference:

[virtual] QString QCompleter::pathFromIndex(const QModelIndex \&index) const

Returns the path for the given index. The completer object uses this to obtain the completion text from the underlying model.

The default implementation returns the edit role of the item for list models. It returns the absolute file path if the model is a QFileSystemModel.

See also splitPath().

Upstream PySide2 reference signatures (binding differences may apply):

pathFromIndex(self, index: PySide2.QtCore.QModelIndex) -> str

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#pathFromIndex

popup

popup() -> Any

X.popup() -> PythonQt.QtGui.QAbstractItemView

Supplemental documentation: Qt 5 reference:

QAbstractItemView *QCompleter::popup() const

Returns the popup used to display completions.

See also setPopup().

Upstream PySide2 reference signatures (binding differences may apply):

popup(self) -> PySide2.QtWidgets.QAbstractItemView

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#popup

setCaseSensitivity

setCaseSensitivity(caseSensitivity: Any) -> None

X.setCaseSensitivity(caseSensitivity)

Upstream PySide2 reference signatures (binding differences may apply):

setCaseSensitivity(self, caseSensitivity: PySide2.QtCore.Qt.CaseSensitivity) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setCaseSensitivity

setCompletionColumn

setCompletionColumn(column: int) -> None

X.setCompletionColumn(column)

Upstream PySide2 reference signatures (binding differences may apply):

setCompletionColumn(self, column: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setCompletionColumn

setCompletionMode

setCompletionMode(mode: Any) -> None

X.setCompletionMode(mode)

Upstream PySide2 reference signatures (binding differences may apply):

setCompletionMode(self, mode: PySide2.QtWidgets.QCompleter.CompletionMode) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setCompletionMode

setCompletionPrefix

setCompletionPrefix(prefix: str) -> None

X.setCompletionPrefix(prefix)

Upstream PySide2 reference signatures (binding differences may apply):

setCompletionPrefix(self, prefix: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setCompletionPrefix

setCompletionRole

setCompletionRole(role: int) -> None

X.setCompletionRole(role)

Upstream PySide2 reference signatures (binding differences may apply):

setCompletionRole(self, role: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setCompletionRole

setCurrentRow

setCurrentRow(row: int) -> bool

X.setCurrentRow(row) -> bool

Supplemental documentation: Qt 5 reference:

bool QCompleter::setCurrentRow(int row)

Sets the current row to the row specified. Returns true if successful; otherwise returns false.

This function may be used along with currentCompletion() to iterate through all the possible completions.

See also currentRow(), currentCompletion(), and completionCount().

Upstream PySide2 reference signatures (binding differences may apply):

setCurrentRow(self, row: int) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setCurrentRow

setFilterMode

setFilterMode(filterMode: Any) -> None

X.setFilterMode(filterMode)

Upstream PySide2 reference signatures (binding differences may apply):

setFilterMode(self, filterMode: PySide2.QtCore.Qt.MatchFlags) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setFilterMode

setMaxVisibleItems

setMaxVisibleItems(maxItems: int) -> None

X.setMaxVisibleItems(maxItems)

Upstream PySide2 reference signatures (binding differences may apply):

setMaxVisibleItems(self, maxItems: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setMaxVisibleItems

setModel

setModel(c: Any) -> None

X.setModel(c)

Supplemental documentation: Qt 5 reference:

void QCompleter::setModel(QAbstractItemModel *model)

Sets the model which provides completions to model. The model can be list model or a tree model. If a model has been already previously set and it has the QCompleter as its parent, it is deleted.

For convenience, if model is a QFileSystemModel, QCompleter switches its caseSensitivity to Qt::CaseInsensitive on Windows and Qt::CaseSensitive on other platforms.

See also completionModel(), modelSorting, and Handling Tree Models.

Upstream PySide2 reference signatures (binding differences may apply):

setModel(self, c: PySide2.QtCore.QAbstractItemModel) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcompleter.html#setModel