LeechCraft  %{LEECHCRAFT_VERSION}
Modular cross-platform feature rich live environment.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LeechCraft::Util::TagsLineEdit Class Reference

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

#include "tagslineedit.h"

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

Public Slots

UTIL_API void insertTag (const QString &string)
 Completes the string. More...
 
UTIL_API void handleTagsUpdated (const QStringList &allTags)
 Sets thew new list of the available tags. More...
 
UTIL_API void setTags (const QStringList &tags)
 Sets the currently selected tags. More...
 

Signals

UTIL_API void tagsChosen ()
 

Public Member Functions

UTIL_API TagsLineEdit (QWidget *parent)
 Constructs the line edit widget. More...
 
UTIL_API void AddSelector ()
 Adds the selector widget to the line edit. More...
 
UTIL_API QString GetSeparator () const
 Returns the separator for the tags. More...
 
UTIL_API 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 50 of file tagslineedit.h.

Constructor & Destructor Documentation

TagsLineEdit::TagsLineEdit ( QWidget *  parent)

Constructs the line edit widget.

Creates the line edit widget.

Parameters
[in]parentParent widget.

Definition at line 42 of file tagslineedit.cpp.

Member Function Documentation

void TagsLineEdit::AddSelector ( )

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.

See Also
TagsCompleter

Definition at line 49 of file tagslineedit.cpp.

References handleTagsUpdated().

+ Here is the call graph for this function:

void TagsLineEdit::contextMenuEvent ( QContextMenuEvent *  e)
protectedvirtual

Definition at line 174 of file tagslineedit.cpp.

void TagsLineEdit::focusInEvent ( QFocusEvent *  e)
protectedvirtual

Definition at line 167 of file tagslineedit.cpp.

QString TagsLineEdit::GetSeparator ( ) const

Returns the separator for the tags.

The default separator is "; ".

See Also
SetSeparator()

Definition at line 79 of file tagslineedit.cpp.

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

+ Here is the caller graph for this function:

void 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 111 of file tagslineedit.cpp.

Referenced by AddSelector().

+ Here is the caller graph for this function:

void 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 91 of file tagslineedit.cpp.

References tagsChosen().

Referenced by SetCompleter().

+ Here is the caller graph for this function:

void TagsLineEdit::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Definition at line 130 of file tagslineedit.cpp.

void TagsLineEdit::SetCompleter ( TagsCompleter c)
protected

Definition at line 186 of file tagslineedit.cpp.

References insertTag().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void 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 84 of file tagslineedit.cpp.

void 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 116 of file tagslineedit.cpp.

UTIL_API void LeechCraft::Util::TagsLineEdit::tagsChosen ( )
signal

Referenced by insertTag().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class TagsCompleter
friend

Definition at line 54 of file tagslineedit.h.


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