![]() |
LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
|
A line edit class suitable for use with TagsCompleter. More...
#include "tagslineedit.h"
Public Slots | |
void | setTags (const QStringList &tags) |
Sets the currently selected tags. | |
Signals | |
void | tagsChosen () |
Public Member Functions | |
TagsLineEdit (QWidget *parent) | |
Constructs the line edit widget. | |
void | AddSelector (LineEditButtonManager *manager=nullptr) |
Adds the selector widget to the line edit. | |
void | AddSelector (CategorySelector *) |
QString | GetSeparator () const |
Returns the separator for the tags. | |
void | SetSeparator (const QString &) |
Sets the separator for the tags. | |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *) override |
void | focusInEvent (QFocusEvent *) override |
void | contextMenuEvent (QContextMenuEvent *) override |
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 28 of file tagslineedit.h.
|
explicit |
Constructs the line edit widget.
Creates the line edit widget.
[in] | parent | Parent widget. |
Definition at line 26 of file tagslineedit.cpp.
References LC::Util::GetDefaultTagsSeparator().
Referenced by TagsCompleter.
void LC::Util::TagsLineEdit::AddSelector | ( | CategorySelector * | selector | ) |
Definition at line 60 of file tagslineedit.cpp.
References LC::Util::CategorySelector::SetSelectionsFromString(), LC::Util::CategorySelector::SetSeparator(), tagsChosen(), and LC::Util::CategorySelector::tagsSelectionChanged().
void LC::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 32 of file tagslineedit.cpp.
References LC::Util::LineEditButtonManager::Add(), and AddSelector().
Referenced by AddSelector(), and TagsCompleter.
|
overrideprotected |
Definition at line 170 of file tagslineedit.cpp.
Referenced by TagsCompleter.
|
overrideprotected |
Definition at line 163 of file tagslineedit.cpp.
Referenced by TagsCompleter.
QString LC::Util::TagsLineEdit::GetSeparator | ( | ) | const |
Returns the separator for the tags.
Definition at line 87 of file tagslineedit.cpp.
Referenced by TagsCompleter.
|
overrideprotected |
Definition at line 126 of file tagslineedit.cpp.
Referenced by TagsCompleter.
|
protected |
Definition at line 182 of file tagslineedit.cpp.
References TagsCompleter.
Referenced by LC::Util::TagsCompleter::TagsCompleter(), and TagsCompleter.
void LC::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 92 of file tagslineedit.cpp.
Referenced by TagsCompleter.
|
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 119 of file tagslineedit.cpp.
Referenced by TagsCompleter.
|
signal |
|
friend |
Definition at line 32 of file tagslineedit.h.
References TagsLineEdit(), AddSelector(), contextMenuEvent(), focusInEvent(), GetSeparator(), keyPressEvent(), SetCompleter(), SetSeparator(), setTags(), and TagsCompleter.
Referenced by SetCompleter(), and TagsCompleter.