LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::TagsCompleter Class Reference

Completer suitable for tag completion. More...

#include "tagscompleter.h"

Inheritance diagram for LC::Util::TagsCompleter:
Collaboration diagram for LC::Util::TagsCompleter:

Public Member Functions

UTIL_TAGS_API TagsCompleter (TagsLineEdit *line)
 Constructs the completer.
UTIL_TAGS_API void OverrideModel (QAbstractItemModel *model)
 Replaces the model this completer works with.
UTIL_TAGS_API QStringList splitPath (const QString &path) const override
 Path splitter override.

Static Protected Member Functions

static void SetModel (QAbstractItemModel *model)

Friends

class LC::TagsManager

Detailed Description

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.

See also
TagsCompletionModel
TagsLineEdit

Definition at line 38 of file tagscompleter.h.

Constructor & Destructor Documentation

◆ TagsCompleter()

LC::Util::TagsCompleter::TagsCompleter ( TagsLineEdit * line)
explicit

Constructs the completer.

Sets up for completion and prepares line for work with itself.

Parameters
[in]lineThe line edit which would be used for tag completion.

Definition at line 18 of file tagscompleter.cpp.

References LC::Util::TagsLineEdit::SetCompleter().

Here is the call graph for this function:

Member Function Documentation

◆ OverrideModel()

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.

Parameters
[in]modelThe model to use.

Definition at line 27 of file tagscompleter.cpp.

◆ SetModel()

void LC::Util::TagsCompleter::SetModel ( QAbstractItemModel * model)
inlinestaticprotected

Definition at line 77 of file tagscompleter.h.

◆ splitPath()

QStringList LC::Util::TagsCompleter::splitPath ( const QString & path) const
override

Path splitter override.

Handles sequence of tags considering its set structure. Splits the path by spaces and returns the resulting string list.

Parameters
[in]pathThe tags sequence to split.
Returns
Splitted sequence.

Definition at line 32 of file tagscompleter.cpp.

◆ LC::TagsManager

friend class LC::TagsManager
friend

Definition at line 43 of file tagscompleter.h.

References LC::TagsManager, and UTIL_TAGS_API.

Referenced by LC::TagsManager.


The documentation for this class was generated from the following files:
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.17609.g3dde4097dd-build/leechcraft-0.6.70-17609-g3dde4097dd/src/util/tags/tagscompleter.h
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.17609.g3dde4097dd-build/leechcraft-0.6.70-17609-g3dde4097dd/src/util/tags/tagscompleter.cpp