LeechCraft  0.6.70-15082-g543737046d
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 *) override
 

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 36 of file lineeditbuttonmanager.h.

Constructor & Destructor Documentation

◆ LineEditButtonManager()

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

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 25 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 48 of file lineeditbuttonmanager.cpp.

◆ eventFilter()

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

Definition at line 61 of file lineeditbuttonmanager.cpp.


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