![]() |
LeechCraft
0.6.70-10870-g558588d6ec
Modular cross-platform feature rich live environment.
|
A line edit class suitable for use with TagsCompleter. More...
#include "tagslineedit.h"
Public Slots | |
void | insertTag (const QString &string) |
Completes the string. More... | |
void | handleTagsUpdated (const QStringList &allTags) |
Sets thew new list of the available tags. More... | |
void | setTags (const QStringList &tags) |
Sets the currently selected tags. More... | |
Signals | |
void | tagsChosen () |
Public Member Functions | |
TagsLineEdit (QWidget *parent) | |
Constructs the line edit widget. More... | |
void | AddSelector (LineEditButtonManager *manager=nullptr) |
Adds the selector widget to the line edit. More... | |
QString | GetSeparator () const |
Returns the separator for the tags. More... | |
void | SetSeparator (const QString &) |
Sets the separator for the tags. More... | |
Protected Member Functions | |
virtual void | keyPressEvent (QKeyEvent *) |
virtual void | focusInEvent (QFocusEvent *) |
virtual void | contextMenuEvent (QContextMenuEvent *) |
void | SetCompleter (TagsCompleter *) |
Friends | |
class | TagsCompleter |
A line edit class suitable for use with TagsCompleter.
One would need this extra class because of custom behavior of both tags completer and line edit semantics.
Definition at line 51 of file tagslineedit.h.
LeechCraft::Util::TagsLineEdit::TagsLineEdit | ( | QWidget * | parent | ) |
Constructs the line edit widget.
Creates the line edit widget.
[in] | parent | Parent widget. |
Definition at line 47 of file tagslineedit.cpp.
void LeechCraft::Util::TagsLineEdit::AddSelector | ( | LineEditButtonManager * | manager = nullptr | ) |
Adds the selector widget to the line edit.
Because this function uses the completion model, it should be used after a TagsCompleter has been set on this line edit.
This function also creates an overlay button to aid user in selecting tags. The passed manager object is used (if it is not nullptr), otherwise a new LineEditButtonManager is created internally to manage this line edit.
[in] | manager | The line edit buttons manager to use, or nullptr to create one. |
Definition at line 54 of file tagslineedit.cpp.
References LeechCraft::Util::LineEditButtonManager::Add(), handleTagsUpdated(), and toString().
|
protectedvirtual |
Definition at line 201 of file tagslineedit.cpp.
|
protectedvirtual |
Definition at line 194 of file tagslineedit.cpp.
QString LeechCraft::Util::TagsLineEdit::GetSeparator | ( | ) | const |
Returns the separator for the tags.
The default separator is "; ".
Definition at line 100 of file tagslineedit.cpp.
Referenced by LeechCraft::Util::TagsCompleter::splitPath().
|
slot |
Sets thew new list of the available tags.
The list of tags will be passed to the selector if it was added via AddSelector().
[in] | allTags | The list of new available tags. |
Definition at line 132 of file tagslineedit.cpp.
Referenced by AddSelector().
|
slot |
Completes the string.
Completes the current text in line edit with completion passed throught string parameter.
[in] | string | String with completion. |
Definition at line 112 of file tagslineedit.cpp.
References tagsChosen().
Referenced by SetCompleter().
|
protectedvirtual |
Definition at line 157 of file tagslineedit.cpp.
|
protected |
Definition at line 213 of file tagslineedit.cpp.
References insertTag().
Referenced by LeechCraft::Util::TagsCompleter::TagsCompleter().
void LeechCraft::Util::TagsLineEdit::SetSeparator | ( | const QString & | sep | ) |
Sets the separator for the tags.
This function doesn't update the text in the line edit.
Definition at line 105 of file tagslineedit.cpp.
|
slot |
Sets the currently selected tags.
Sets the line edit text to tags joined by separator. If tags selector is installed via AddSelector(), the selector is updated as well.
[in] | tags | The list of selected tags. |
Definition at line 137 of file tagslineedit.cpp.
|
signal |
|
friend |
Definition at line 55 of file tagslineedit.h.