![]() |
Crossfire Resources Editor
|
Multiline edit with auto-completion for asset fields. More...
#include <AssetTextEdit.h>
Inheritance diagram for AssetTextEdit:
Collaboration diagram for AssetTextEdit:Public Member Functions | |
| AssetTextEdit (QWidget *parent) | |
| Constructor. More... | |
Protected Member Functions | |
| virtual void | keyPressEvent (QKeyEvent *e) override |
Private Slots | |
| void | insertCompletion (const QString &completion) |
| Insert the completed text at the cursor's position, replacing part of the contents if needed. More... | |
Private Member Functions | |
| QString | textUnderCursor () const |
| Get the complete text under the cursor, including all letters and dots before, all letters after. More... | |
Private Attributes | |
| AssetFieldCompleter * | myCompleter |
| Completer used to suggest words. More... | |
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.
Here is the call graph for this function:
|
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().
Here is the caller graph for this function:
|
overrideprotectedvirtual |
Definition at line 26 of file AssetTextEdit.cpp.
References myCompleter, and textUnderCursor().
Here is the call graph for this function:
|
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().
Here is the caller graph for this function:
|
private |
Completer used to suggest words.
Definition at line 39 of file AssetTextEdit.h.
Referenced by AssetTextEdit(), insertCompletion(), and keyPressEvent().