Qt Utilities 6.14.0
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
QtUtilities::ClearLineEdit Class Reference

A QLineEdit with an embedded button for clearing its contents. More...

#include <clearlineedit.h>

Inheritance diagram for QtUtilities::ClearLineEdit:
[legend]
Collaboration diagram for QtUtilities::ClearLineEdit:
[legend]

Public Member Functions

 ClearLineEdit (QWidget *parent=nullptr)
 Constructs a clear line edit.
 
 ~ClearLineEdit () override
 Destroys the clear combo box.
 
bool isCleared () const override
 Returns whether the related widget is cleared.
 
- Public Member Functions inherited from QtUtilities::ButtonOverlay
 ButtonOverlay (QWidget *widget)
 Constructs a button overlay for the specified widget.
 
 ButtonOverlay (QWidget *widget, QLineEdit *lineEdit)
 Constructs a button overlay for the specified widget.
 
virtual ~ButtonOverlay ()
 Destroys the button overlay.
 
bool isUsingCustomLayout () const
 Returns whether the "custom approach" mentioned in the class documentation is used.
 
QHBoxLayout * buttonLayout ()
 Returns the layout manager holding the buttons.
 
bool isClearButtonEnabled () const
 Returns whether the clear button is enabled.
 
void setClearButtonEnabled (bool enabled)
 Sets whether the clear button is enabled.
 
bool isInfoButtonEnabled () const
 Returns whether the info button is enabled.
 
void enableInfoButton (const QPixmap &pixmap, const QString &infoText)
 Shows an info button with the specified pixmap and infoText.
 
void disableInfoButton ()
 Hides an info button if one is shown.
 
void addCustomButton (QWidget *button)
 Adds a custom button.
 
void insertCustomButton (int index, QWidget *button)
 Inserts a custom button at the specified index.
 
void removeCustomButton (QWidget *button)
 Removes the specified custom button; does nothing if button has not been added.
 
void addCustomAction (QAction *action)
 Adds a custom action.
 
void insertCustomAction (int index, QAction *action)
 Inserts a custom action at the specified index.
 
void removeCustomAction (QAction *action)
 Removes the specified custom action; does nothing if action has not been added.
 

Properties

bool cleared
 

Additional Inherited Members

- Protected Member Functions inherited from QtUtilities::ButtonOverlay
void updateClearButtonVisibility (bool visible)
 Updates the visibility of the clear button.
 
virtual void handleClearButtonClicked ()
 Clears the related widget.
 
virtual void handleCustomLayoutCreated ()
 Applies additional handling when the button layout has been created.
 

Detailed Description

A QLineEdit with an embedded button for clearing its contents.

Definition at line 14 of file clearlineedit.h.

Constructor & Destructor Documentation

◆ ClearLineEdit()

QtUtilities::ClearLineEdit::ClearLineEdit ( QWidget * parent = nullptr)
explicit

Constructs a clear line edit.

Definition at line 16 of file clearlineedit.cpp.

◆ ~ClearLineEdit()

QtUtilities::ClearLineEdit::~ClearLineEdit ( )
override

Destroys the clear combo box.

Definition at line 26 of file clearlineedit.cpp.

Member Function Documentation

◆ isCleared()

bool QtUtilities::ClearLineEdit::isCleared ( ) const
overridevirtual

Returns whether the related widget is cleared.

This method is meant to be implemented when subclassing.

Reimplemented from QtUtilities::ButtonOverlay.

Definition at line 53 of file clearlineedit.cpp.

Property Documentation

◆ cleared

bool QtUtilities::ClearLineEdit::cleared
read

Definition at line 16 of file clearlineedit.h.


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