LeechCraft  0.6.70-13605-g8cd066ad6a
Modular cross-platform feature rich live environment.
LC::Util::TagsLineEdit Class Reference

A line edit class suitable for use with TagsCompleter. More...

#include "tagslineedit.h"

+ Inheritance diagram for LC::Util::TagsLineEdit:
+ Collaboration diagram for LC::Util::TagsLineEdit:

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
 

Detailed Description

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.

See also
TagsCompleter

Definition at line 102 of file tagslineedit.h.

Constructor & Destructor Documentation

◆ TagsLineEdit()

LC::Util::TagsLineEdit::TagsLineEdit ( QWidget *  parent)

Constructs the line edit widget.

Creates the line edit widget.

Parameters
[in]parentParent widget.

Definition at line 98 of file tagslineedit.cpp.

Member Function Documentation

◆ AddSelector()

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.

Parameters
[in]managerThe line edit buttons manager to use, or nullptr to create one.
See also
TagsCompleter

Definition at line 105 of file tagslineedit.cpp.

◆ contextMenuEvent()

void LC::Util::TagsLineEdit::contextMenuEvent ( QContextMenuEvent *  e)
protectedvirtual

Definition at line 252 of file tagslineedit.cpp.

◆ focusInEvent()

void LC::Util::TagsLineEdit::focusInEvent ( QFocusEvent *  e)
protectedvirtual

Definition at line 245 of file tagslineedit.cpp.

◆ GetSeparator()

QString LC::Util::TagsLineEdit::GetSeparator ( ) const

Returns the separator for the tags.

The default separator is "; ".

See also
SetSeparator()

Definition at line 151 of file tagslineedit.cpp.

Referenced by LC::Util::TagsCompleter::splitPath().

+ Here is the caller graph for this function:

◆ handleTagsUpdated

void LC::Util::TagsLineEdit::handleTagsUpdated ( const QStringList &  allTags)
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().

Parameters
[in]allTagsThe list of new available tags.

Definition at line 183 of file tagslineedit.cpp.

◆ insertTag

void LC::Util::TagsLineEdit::insertTag ( const QString &  string)
slot

Completes the string.

Completes the current text in line edit with completion passed throught string parameter.

Parameters
[in]stringString with completion.

Definition at line 163 of file tagslineedit.cpp.

◆ keyPressEvent()

void LC::Util::TagsLineEdit::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Definition at line 208 of file tagslineedit.cpp.

◆ SetCompleter()

void LC::Util::TagsLineEdit::SetCompleter ( TagsCompleter c)
protected

Definition at line 264 of file tagslineedit.cpp.

Referenced by LC::Util::TagsCompleter::TagsCompleter().

+ Here is the caller graph for this function:

◆ SetSeparator()

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.

See also
GetSeparator()

Definition at line 156 of file tagslineedit.cpp.

◆ setTags

void LC::Util::TagsLineEdit::setTags ( const QStringList &  tags)
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.

Parameters
[in]tagsThe list of selected tags.

Definition at line 188 of file tagslineedit.cpp.

◆ tagsChosen

void LC::Util::TagsLineEdit::tagsChosen ( )
signal

Friends And Related Function Documentation

◆ TagsCompleter

friend class TagsCompleter
friend

Definition at line 106 of file tagslineedit.h.


The documentation for this class was generated from the following files: