LeechCraft  0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
LC::Util::LineEditButtonManager Class Reference

Manages additional overlay buttons in a QLineEdit. More...

#include "lineeditbuttonmanager.h"

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

Public Member Functions

 LineEditButtonManager (QLineEdit *edit)
 Constructs the manager for the line edit. More...
 
void Add (QToolButton *button)
 Adds a button to the line edit. More...
 

Protected Member Functions

bool eventFilter (QObject *, QEvent *)
 

Detailed Description

Manages additional overlay buttons in a QLineEdit.

This class manages custom buttons (like "Clear") on a QLineEdit or a derived class. Particularly, it lays outs the buttons next to each other and updates their positions when the managed line edit is moved or resized.

Only one LineEditButtonManager can be installed on a single QLineEdit. Installing more than one manager will result in an exception thrown from the constructor.

The managed line edit owns the created LineEditButtonManager.

See also
ClearLineEditAddon

Definition at line 59 of file lineeditbuttonmanager.h.

Constructor & Destructor Documentation

◆ LineEditButtonManager()

LC::Util::LineEditButtonManager::LineEditButtonManager ( QLineEdit *  edit)

Constructs the manager for the line edit.

Constructs the LineEditButtonManager managing the given line edit.

edit becomes the owner of the manager.

Parameters
[in]editThe line edit to manage.
Exceptions
std::runtime_errorthe line edit is already managed by another LineEditButtonManager instance.

Definition at line 42 of file lineeditbuttonmanager.cpp.

Member Function Documentation

◆ Add()

void LC::Util::LineEditButtonManager::Add ( QToolButton *  button)

Adds a button to the line edit.

Parameters
[in]buttonThe button to add to the managed line edit.

Definition at line 62 of file lineeditbuttonmanager.cpp.

Referenced by LC::Util::TagsLineEdit::AddSelector().

+ Here is the caller graph for this function:

◆ eventFilter()

bool LC::Util::LineEditButtonManager::eventFilter ( QObject *  obj,
QEvent *  event 
)
protected

Definition at line 75 of file lineeditbuttonmanager.cpp.

References LC::Util::Move, and LC::Util::Resize.


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