Crossfire Server, Trunk
|
#include <AssetTextEdit.h>
Public Member Functions | |
AssetTextEdit (QWidget *parent) | |
Protected Member Functions | |
virtual void | keyPressEvent (QKeyEvent *e) override |
Private Slots | |
void | insertCompletion (const QString &completion) |
Private Member Functions | |
QString | textUnderCursor () const |
Private Attributes | |
AssetFieldCompleter * | myCompleter |
Multiline edit with auto-completion for asset fields. This class relies on AssetFieldCompleter for completion. The code is heavily borrowed from https://doc.qt.io/qt-6/qtwidgets-tools-customcompleter-example.html
Definition at line 25 of file AssetTextEdit.h.
AssetTextEdit::AssetTextEdit | ( | QWidget * | parent | ) |
Constructor.
parent | parent widget. |
Definition at line 17 of file AssetTextEdit.cpp.
References insertCompletion(), and myCompleter.
|
privateslot |
Insert the completed text at the cursor's position, replacing part of the contents if needed.
completion | text to insert. |
Definition at line 54 of file AssetTextEdit.cpp.
References myCompleter.
Referenced by AssetTextEdit().
|
overrideprotectedvirtual |
Definition at line 26 of file AssetTextEdit.cpp.
References myCompleter, and textUnderCursor().
|
private |
Get the complete text under the cursor, including all letters and dots before, all letters after.
Definition at line 63 of file AssetTextEdit.cpp.
Referenced by keyPressEvent().
|
private |
Completer used to suggest words.
Definition at line 39 of file AssetTextEdit.h.
Referenced by AssetTextEdit(), insertCompletion(), and keyPressEvent().