pqTextEdit is a specialization of QTextEdit which provide editingFinished() and textChangedAndEditingFinished() signals, as well as the possibility to be autocompleted. More...
#include <pqTextEdit.h>
Signals | |
void | textChangedAndEditingFinished () |
Unlike editingFinished() which gets fired whenever the widget looses focus irrespective of if the text actually was edited, textChangedAndEditingFinished() is fired only when the text was changed as well. More... | |
void | editingFinished () |
Just like the QLineEdit::editingFinished(), this signal is fired every time the widget loses focus. More... | |
Public Member Functions | |
pqTextEdit (QWidget *parent=nullptr) | |
pqTextEdit (const QString &contents, QWidget *parent=nullptr) | |
void | setCompleter (pqWidgetCompleter *completer) |
pqWidgetCompleter * | getCompleter () |
~pqTextEdit () override | |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *e) override |
void | focusOutEvent (QFocusEvent *e) override |
void | focusInEvent (QFocusEvent *e) override |
QString | textUnderCursor () const |
Returns the text of the current line in the input field. More... | |
void | updateCompleter () |
Trigger an update on the completer if any, and show the popup if completions are available. More... | |
void | updateCompleterIfVisible () |
In case the completer popup menu is already shown, update it to reflect modifications on the input text. More... | |
void | selectCompletion () |
Insert the completion in case there is only one available. More... | |
Protected Attributes | |
QScopedPointer< pqTextEditPrivate > | d_ptr |
pqTextEdit is a specialization of QTextEdit which provide editingFinished() and textChangedAndEditingFinished() signals, as well as the possibility to be autocompleted.
An autocompleter object can be set using setCompleter(). For this, autocompleter must implement the updateCompletionModel() method through the interface defined by pqWidgetCompleter, providing completion for a given string.
Unlike editingFinished() which gets fired whenever the widget looses focus irrespective of if the text if actually was edited, textChangedAndEditingFinished() is fired only when the text was changed as well.
Important Notes: The editingFinished() signals and the textChangedAndEditingFinished() are NOT sent when using the setText, setPlainText and setHtml methods.
Also the textChangedAndEditingFinished() is not truly emitted only when the text has changed and the edition is finished. For example, removing a letter and adding it back will cause the signal to be fired even though the text is the same as before.
Definition at line 37 of file pqTextEdit.h.
pqTextEdit::pqTextEdit | ( | QWidget * | parent = nullptr | ) |
pqTextEdit::pqTextEdit | ( | const QString & | contents, |
QWidget * | parent = nullptr |
||
) |
|
override |
void pqTextEdit::setCompleter | ( | pqWidgetCompleter * | completer | ) |
|
inline |
Definition at line 47 of file pqTextEdit.h.
|
signal |
Unlike editingFinished() which gets fired whenever the widget looses focus irrespective of if the text actually was edited, textChangedAndEditingFinished() is fired only when the text was changed as well.
|
signal |
Just like the QLineEdit::editingFinished(), this signal is fired every time the widget loses focus.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
protected |
Returns the text of the current line in the input field.
|
protected |
Trigger an update on the completer if any, and show the popup if completions are available.
|
protected |
In case the completer popup menu is already shown, update it to reflect modifications on the input text.
|
protected |
Insert the completion in case there is only one available.
|
protected |
Definition at line 97 of file pqTextEdit.h.