LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::ClearLineEditAddon Class Reference

Provides a "clear text" action for line edits. More...

#include "clearlineeditaddon.h"

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

Public Member Functions

 ClearLineEditAddon (const ICoreProxy_ptr &proxy, QLineEdit *edit)
 Creates the addon and installs it on the given edit.
 
 ClearLineEditAddon (const ICoreProxy_ptr &proxy, QLineEdit *edit, LineEditButtonManager *manager)
 Creates the addon and installs it on the given edit.
 
void SetEscClearsEdit (bool clears)
 Toggles whether Esc button clears the line edit.
 

Detailed Description

Provides a "clear text" action for line edits.

Using this class is as simple as this:

QLineEdit *edit = ...; // or some QLineEdit-derived class
new ClearLineEditAddon { proxy, edit }; // proxy is the one passed to IInfo::Init()
Provides a "clear text" action for line edits.
Container< T > Filter(const Container< T > &c, F f)
Definition prelude.h:118

The constructor takes a pointer to the proxy object that is passed to IInfo::Init() method of the plugin instance object and the pointer to the line edit where the addon should be installed.

The line edit takes the ownership of the addon, so there is no need to keep track of it or explicitly delete it.

See also
IInfo::Init()

Definition at line 42 of file clearlineeditaddon.h.

Constructor & Destructor Documentation

◆ ClearLineEditAddon() [1/2]

LC::Util::ClearLineEditAddon::ClearLineEditAddon ( const ICoreProxy_ptr & proxy,
QLineEdit * edit )

Creates the addon and installs it on the given edit.

Please note that if you want to use this addon with other buttons on the line edit you may consider using another constructor overload, taking an additional LineEditButtonManager parameter.

Parameters
[in]proxyThe proxy passed to IInfo::Init() of the plugin.
[in]editThe line edit to install this addon into. The edit takes ownership of the addon.

Definition at line 20 of file clearlineeditaddon.cpp.

◆ ClearLineEditAddon() [2/2]

LC::Util::ClearLineEditAddon::ClearLineEditAddon ( const ICoreProxy_ptr & proxy,
QLineEdit * edit,
LineEditButtonManager * manager )

Creates the addon and installs it on the given edit.

This constructors allows the line edit addon to be used easily with other buttons installed on the line edit using the passed button manager.

Parameters
[in]proxyThe proxy passed to IInfo::Init() of the plugin.
[in]editThe line edit to install this addon into. The edit takes ownership of the addon.
[in]managerThe line edit button manager to use instead of the default internal one.

Definition at line 25 of file clearlineeditaddon.cpp.

References LC::Util::Filter().

+ Here is the call graph for this function:

Member Function Documentation

◆ SetEscClearsEdit()

void LC::Util::ClearLineEditAddon::SetEscClearsEdit ( bool clears)

Toggles whether Esc button clears the line edit.

By default, Esc clears the line edit.

Parameters
[in]clearsWhether pressing Esc should clear the line edit.

Definition at line 56 of file clearlineeditaddon.cpp.

References LC::Util::Filter().

+ Here is the call graph for this function:

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