Qt Utilities
6.4.1
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
|
A QSpinBox with an embedded button for clearing its contents and the ability to hide the minimum value. More...
#include <clearspinbox.h>
Public Member Functions | |
ClearSpinBox (QWidget *parent=nullptr) | |
Constructs a clear spin box. More... | |
~ClearSpinBox () override | |
Destroys the clear spin box. More... | |
bool | minimumHidden () const |
Returns whether the minimum value will be hidden. More... | |
void | setMinimumHidden (bool value) |
Sets whether the minimum value should be hidden. More... | |
QString | placeholderText () const |
Returns the placeholder text. More... | |
void | setPlaceholderText (const QString &placeholderText) |
Sets the placeholder text. More... | |
bool | isCleared () const override |
Returns whether the related widget is cleared. More... | |
![]() | |
ButtonOverlay (QWidget *widget) | |
Constructs a button overlay for the specified widget. More... | |
ButtonOverlay (QWidget *widget, QLineEdit *lineEdit) | |
Constructs a button overlay for the specified widget. More... | |
virtual | ~ButtonOverlay () |
Destroys the button overlay. More... | |
bool | isUsingCustomLayout () const |
Returns whether the "custom approach" mentioned in the class documentation is used. More... | |
QHBoxLayout * | buttonLayout () |
Returns the layout manager holding the buttons. More... | |
bool | isClearButtonEnabled () const |
Returns whether the clear button is enabled. More... | |
void | setClearButtonEnabled (bool enabled) |
Sets whether the clear button is enabled. More... | |
bool | isInfoButtonEnabled () const |
Returns whether the info button is enabled. More... | |
void | enableInfoButton (const QPixmap &pixmap, const QString &infoText) |
Shows an info button with the specified pixmap and infoText. More... | |
void | disableInfoButton () |
Hides an info button if one is shown. More... | |
void | addCustomButton (QWidget *button) |
Adds a custom button. More... | |
void | insertCustomButton (int index, QWidget *button) |
Inserts a custom button at the specified index. More... | |
void | removeCustomButton (QWidget *button) |
Removes the specified custom button; does nothing if button has not been added. More... | |
void | addCustomAction (QAction *action) |
Adds a custom action. More... | |
void | insertCustomAction (int index, QAction *action) |
Inserts a custom action at the specified index. More... | |
void | removeCustomAction (QAction *action) |
Removes the specified custom action; does nothing if action has not been added. More... | |
Protected Member Functions | |
int | valueFromText (const QString &text) const override |
QString | textFromValue (int val) const override |
![]() | |
void | updateClearButtonVisibility (bool visible) |
Updates the visibility of the clear button. More... | |
virtual void | handleClearButtonClicked () |
Clears the related widget. More... | |
virtual void | handleCustomLayoutCreated () |
Applies additional handling when the button layout has been created. More... | |
Properties | |
bool | cleared |
bool | minimumHidden |
QString | placeholderText |
A QSpinBox with an embedded button for clearing its contents and the ability to hide the minimum value.
Definition at line 15 of file clearspinbox.h.
|
explicit |
Constructs a clear spin box.
Definition at line 19 of file clearspinbox.cpp.
|
override |
Destroys the clear spin box.
Definition at line 30 of file clearspinbox.cpp.
|
overridevirtual |
Returns whether the related widget is cleared.
This method is meant to be implemented when subclassing.
Reimplemented from QtUtilities::ButtonOverlay.
Definition at line 57 of file clearspinbox.cpp.
|
inline |
Returns whether the minimum value will be hidden.
Definition at line 46 of file clearspinbox.h.
|
inline |
Returns the placeholder text.
Definition at line 63 of file clearspinbox.h.
|
inline |
Sets whether the minimum value should be hidden.
Definition at line 54 of file clearspinbox.h.
|
inline |
Sets the placeholder text.
Definition at line 72 of file clearspinbox.h.
|
overrideprotected |
Definition at line 71 of file clearspinbox.cpp.
|
overrideprotected |
Definition at line 62 of file clearspinbox.cpp.
|
read |
Definition at line 72 of file clearspinbox.h.
|
readwrite |
Definition at line 72 of file clearspinbox.h.
|
readwrite |
Definition at line 72 of file clearspinbox.h.