|
hydrogen 1.2.3
|
Custom spin box. More...
#include <LCDSpinBox.h>
Public Types | |
| enum class | Kind { Default , PatternSizeNumerator , PatternSizeDenominator } |
| enum class | Type { Int , Double } |
Public Slots | |
| void | onPreferencesChanged (H2Core::Preferences::Changes changes) |
| void | setValue (double fValue) |
Signals | |
| void | slashKeyPressed () |
| void | valueChanged (int) |
Public Member Functions | |
| LCDSpinBox (QWidget *pParent, QSize size=QSize(), Type type=Type::Int, double fMin=0.0, double fMax=1.0, bool bModifyOnChange=false, bool bMinusOneAsOff=false) | |
| ~LCDSpinBox () | |
| bool | getIsActive () const |
| bool | getIsHovered () const |
| void | setIsActive (bool bIsActive) |
| void | setKind (Kind kind) |
| void | setModifyOnChange (bool bModifyOnChange) |
| void | setSize (QSize size) |
| void | setType (Type type) |
| virtual QValidator::State | validate (QString &text, int &pos) const override |
Public Member Functions inherited from Object< LCDSpinBox > | |
| Object () | |
| Object (const Object< LCDSpinBox > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
| virtual QString | toQString (const QString &sPrefix="", bool bShort=true) const |
| Formatted string version for debugging purposes. | |
Private Slots | |
| void | valueChanged (double fNewValue) |
Private Member Functions | |
| virtual void | enterEvent (QEvent *ev) override |
| virtual bool | event (QEvent *ev) override |
| virtual void | keyPressEvent (QKeyEvent *ev) override |
| virtual void | leaveEvent (QEvent *ev) override |
| virtual void | mouseMoveEvent (QMouseEvent *ev) override |
| virtual void | mousePressEvent (QMouseEvent *ev) override |
| virtual void | mouseReleaseEvent (QMouseEvent *ev) override |
| double | nextValueInPatternSizeDenominator (bool bUp, bool bAccelerated) |
| virtual void | paintEvent (QPaintEvent *ev) override |
| virtual QString | textFromValue (double fValue) const override |
| void | updateStyleSheet () |
| virtual double | valueFromText (const QString &sText) const override |
| virtual void | wheelEvent (QWheelEvent *ev) override |
Private Attributes | |
| bool | m_bEntered |
| bool | m_bIsActive |
| bool | m_bMinusOneAsOff |
| In some widgets the QString "off" will be displayed instead of -1. | |
| bool | m_bModifyOnChange |
Whether Hydrogen::setIsModified() is invoked with true as soon as the value of the widget does change. | |
| Kind | m_kind |
| QSize | m_size |
| Type | m_type |
Additional Inherited Members | |
Static Public Member Functions inherited from Base | |
| static const char * | _class_name () |
| return the class name | |
| static QString | base_clock (const QString &sMsg) |
| Measures the current time and stores it in __last_clock. | |
| static QString | base_clock_in (const QString &sMsg) |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! | |
| static bool | count_active () |
| static int | getAliveObjectCount () |
| static object_map_t | getObjectMap () |
| static Logger * | logger () |
| return the logger instance | |
| static int | objects_count () |
| static void | printObjectMapDiff (object_map_t map) |
| Creates the difference between a snapshot of the object map and its current state and prints it to std::cout. | |
| static void | set_count (bool flag) |
| enable/disable class instances counting | |
| static void | write_objects_map_to (std::ostream &out, object_map_t *map=nullptr) |
| output the full objects map to a given ostream | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr | |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Protected Member Functions inherited from Object< LCDSpinBox > | |
| ~Object () | |
Protected Member Functions inherited from Base | |
| ~Base () | |
Static Protected Member Functions inherited from Base | |
| static void | registerClass (const char *name, const atomic_obj_cpt_t *counters) |
Static Protected Attributes inherited from Base | |
| static bool | __count = false |
| should we count class instances | |
| static timeval | __last_clock = { 0, 0 } |
| static Logger * | __logger = nullptr |
Custom spin box.
The QDoubleSpinBox is used for both integer and float values instead of using QSpinBox as a base for the former. This is done to keep the code concise. All internal values will be handled as floats and only textFromValue() makes a difference.
The LCDSpinBox::Kind was introduced to handle custom constraints for the widgets concerning with the pattern size in the PatternEditorPanel.
Updating the font family in QDoubleSpinBox is not supported and changing the font size (both via setFont()) yields erratic results.
Definition at line 49 of file LCDSpinBox.h.
|
strong |
Definition at line 61 of file LCDSpinBox.h.
|
strong |
| Enumerator | |
|---|---|
| Int | |
| Double | |
Definition at line 56 of file LCDSpinBox.h.
| LCDSpinBox | ( | QWidget * | pParent, |
| QSize | size = QSize(), | ||
| Type | type = Type::Int, | ||
| double | fMin = 0.0, | ||
| double | fMax = 1.0, | ||
| bool | bModifyOnChange = false, | ||
| bool | bMinusOneAsOff = false ) |
Definition at line 31 of file LCDSpinBox.cpp.
| ~LCDSpinBox | ( | ) |
Definition at line 63 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 367 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 295 of file LCDSpinBox.cpp.
|
inline |
Definition at line 138 of file LCDSpinBox.h.
|
inline |
Definition at line 141 of file LCDSpinBox.h.
|
overrideprivatevirtual |
Definition at line 136 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 372 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 315 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 305 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 325 of file LCDSpinBox.cpp.
|
private |
Definition at line 187 of file LCDSpinBox.cpp.
|
slot |
Definition at line 414 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 335 of file LCDSpinBox.cpp.
| void setIsActive | ( | bool | bIsActive | ) |
Definition at line 84 of file LCDSpinBox.cpp.
|
inline |
Definition at line 132 of file LCDSpinBox.h.
|
inline |
Definition at line 135 of file LCDSpinBox.h.
| void setSize | ( | QSize | size | ) |
Definition at line 77 of file LCDSpinBox.cpp.
| void setType | ( | Type | type | ) |
Definition at line 66 of file LCDSpinBox.cpp.
|
slot |
Definition at line 287 of file LCDSpinBox.cpp.
|
signal |
|
overrideprivatevirtual |
Definition at line 225 of file LCDSpinBox.cpp.
|
private |
Definition at line 377 of file LCDSpinBox.cpp.
|
overridevirtual |
Definition at line 242 of file LCDSpinBox.cpp.
|
privateslot |
Definition at line 421 of file LCDSpinBox.cpp.
|
signal |
|
overrideprivatevirtual |
Definition at line 274 of file LCDSpinBox.cpp.
|
overrideprivatevirtual |
Definition at line 93 of file LCDSpinBox.cpp.
|
private |
Definition at line 107 of file LCDSpinBox.h.
|
private |
Definition at line 108 of file LCDSpinBox.h.
|
private |
In some widgets the QString "off" will be displayed instead of -1.
Definition at line 112 of file LCDSpinBox.h.
|
private |
Whether Hydrogen::setIsModified() is invoked with true as soon as the value of the widget does change.
Definition at line 116 of file LCDSpinBox.h.
|
private |
Definition at line 105 of file LCDSpinBox.h.
|
private |
Definition at line 103 of file LCDSpinBox.h.
|
private |
Definition at line 104 of file LCDSpinBox.h.