exopy.utils.widgets.qt_completers module

Widgets with support for text completion.

class exopy.utils.widgets.qt_completers.QDelimitedCompleter(parent, delimiters, entries, entries_updater)[source]

Bases: PyQt5.QtWidgets.QCompleter

A custom completer to use with QtLineCompleter, QtTextEdit.

This completer only propose completion between specified characters.

Parameters
  • parent (QLineEdit or QTextEdit) – Widget for which to provide a completion.

  • delimiters (tuple) – Tuple of length 2 specifying the characters marking the begining end of completion.

  • entries (iterable) – Iterable of values used to propose completion.

  • entries_updaters (callable) – Callable used to refresh the list of entries called once for the first completion after the widget gained focus.

completionNeeded
text_changed(text=None)[source]

Callback handling the text being edited on the parent.

complete_text(completion)[source]

When the user validate a completion add it to the text.

on_focus_gained()[source]

Mark the entries for refreshing when the widget loses focus.

class exopy.utils.widgets.qt_completers.QtLineCompleter(parent=None, **kwargs)[source]

Bases: enaml.widgets.raw_widget.RawWidget

Simple line editor supporting completion.

text

Text being edited by this widget.

entries

Static list of entries used to propose completion. This member value is not updated by the entries_updater.

entries_updater

Callable to use to refresh the completions.

delimiters

Delimiters marking the begining and end of completed section.

hug_width = 'ignore'
features = <enum: Feature.FocusEvents [value=2]>
create_widget(parent)[source]

Finishes initializing by creating the underlying toolkit widget.

update_object()[source]

Handles the user entering input data in the edit control.

focus_gained()[source]

Notify the completer the focus was lost.

w
e
a
k
r
f
class exopy.utils.widgets.qt_completers.QCompletableTexEdit[source]

Bases: PyQt5.QtWidgets.QTextEdit

A QTextEdit letting the completer handles key presses when visible.

keyPressEvent(event)[source]

Overriden to let the completer handle some events when visible.

completer
class exopy.utils.widgets.qt_completers.QtTextCompleter(parent=None, **kwargs)[source]

Bases: enaml.widgets.raw_widget.RawWidget

Simple text editor supporting completion.

text

Text being edited by this widget.

entries

Static list of entries used to propose completion. This member value is not updated by the entries_updater.

entries_updater

Callable to use to refresh the completions.

delimiters

Delimiters marking the begining and end of completed section.

hug_width = 'ignore'
features = <enum: Feature.FocusEvents [value=2]>
create_widget(parent)[source]

Finishes initializing by creating the underlying toolkit widget.

update_object()[source]

Handles the user entering input data in the edit control.

w
e
a
k
r
f
focus_gained()[source]

Notify the completer the focus was lost.