LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Completer suitable for tag completion. More...
#include "tagscompleter.h"
Public Member Functions | |
UTIL_TAGS_API | TagsCompleter (TagsLineEdit *line) |
Constructs the completer. More... | |
UTIL_TAGS_API void | OverrideModel (QAbstractItemModel *model) |
Replaces the model this completer works with. More... | |
UTIL_TAGS_API QStringList | splitPath (const QString &path) const override |
Path splitter override. More... | |
Static Protected Member Functions | |
static void | SetModel (QAbstractItemModel *model) |
Friends | |
class | LC::TagsManager |
Completer suitable for tag completion.
Handles tag completions. One would need special class for this because standard QCompleter doesn't work: tag sequence isn't hierarchical, it is rather a set.
Despite the TagsCompleter is designed for tags completion and, consequently, uses the globally available tags model from LeechCraft's tags manager, it's possible to use the completer for other ';'-separated lists of values, by setting the appropriate completion model via OverrideModel() method.
Definition at line 38 of file tagscompleter.h.
|
explicit |
Constructs the completer.
Sets up for completion and prepares line for work with itself.
[in] | line | The line edit which would be used for tag completion. |
Definition at line 24 of file tagscompleter.cpp.
void LC::Util::TagsCompleter::OverrideModel | ( | QAbstractItemModel * | model | ) |
Replaces the model this completer works with.
By default, the completer uses global tags model, which is suitable for autocompletion of tags. If you want to use a custom model with custom contents, use this method to override the model used for completion.
[in] | model | The model to use. |
Definition at line 33 of file tagscompleter.cpp.
References LC::Util::TagsLineEdit::GetSeparator().
|
inlinestaticprotected |
Definition at line 77 of file tagscompleter.h.
|
override |
Path splitter override.
Handles sequence of tags considering its set structure. Splits the path by spaces and returns the resulting string list.
[in] | path | The tags sequence to split. |
Definition at line 38 of file tagscompleter.cpp.
|
friend |
Definition at line 43 of file tagscompleter.h.