JKQtExtras
a library of useful Qt widgets and tools
|
18 #ifndef JKTEDOUBLEEDIT_H
19 #define JKTEDOUBLEEDIT_H
21 #include "jkqtextras_imexport.h"
23 #include <QRegExpValidator>
25 #include <QToolButton>
60 Q_PROPERTY(
int decimals READ decimals WRITE setDecimals USER
true )
61 Q_PROPERTY(
double value READ value WRITE setValue USER
true )
62 Q_PROPERTY(
double increment READ increment WRITE setIncrement USER
true )
63 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum USER
true )
64 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum USER
true )
65 Q_PROPERTY(
bool checkMaximum READ checkMaximum WRITE setCheckMaximum USER
true )
66 Q_PROPERTY(
bool checkMinimum READ checkMinimum WRITE setCheckMinimum USER
true )
67 Q_PROPERTY(
bool showUpDown READ showUpDown WRITE setShowUpDown USER
true )
68 Q_PROPERTY(
bool integerWidget READ isIntegerWidget WRITE setIntegerWidget USER
true )
69 Q_PROPERTY(QColor errorBackgroundColor READ errorBackgroundColor WRITE setErrorBackgroundColor USER
true )
70 Q_PROPERTY(QColor noIntegerBackgroundColor READ noIntegerBackgroundColor WRITE setNoIntegerBackgroundColor USER
true )
71 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor USER
true )
188 #endif // JKTEDOUBLEEDIT_H
double m_current
Definition: jkqtedoubleedit.h:178
double value() const
return the value entered in this widget
double increment() const
increment, when using the buttons or up/down keys
void deleteContextmenuAction(QAction *menuAction)
remove a given QAction from the default context menu (added with addContextmenuAction() )
void setCheckMaximum(bool check)
sets whether the range maximum is checked
void setDecimals(int decimals)
set the number of displayed decimals
void setValidator(const QValidator *validator)
hidden setValidator() method
QColor m_errorColor
error color
Definition: jkqtedoubleedit.h:164
void stepDown()
decrease value by increment()
void setCheckBounds(bool min, bool max)
sets which bounds of the range to checked
virtual void focusOutEvent(QFocusEvent *event)
void updateWidget(const QString &text)
void setMinimum(double value)
minimum of the value range, also calls setCheckMinimum(true)
QColor m_background
Definition: jkqtedoubleedit.h:165
int decimals() const
returns the number of displayed decimals
void keyEventMatches(int key, Qt::KeyboardModifiers modifiers)
emitted when a key event matches
virtual ~JKQTEDoubleEdit()
class destructor
double m_increment
Definition: jkqtedoubleedit.h:169
double minimum() const
minimum of the value range
void setCheckMinimum(bool check)
sets whether the range minimum is checked
void addContextmenuAction(QAction *menuAction)
add a new QAction to the default context menu (append after a seprator)
void stepUp()
increase value by increment()
QString JKDoubleEdit_BASIC_REGEXP
Definition: jkqtedoubleedit.h:173
void setSingleStep(double inc)
sets the single step increment (equivalent to setIncrement(inc) )
virtual void resizeEvent(QResizeEvent *event)
double maximum() const
maximum of the value range
void setRange(double min, double max)
set the value range, also calls setCheckMaximum(true) and setCheckMinimum(true)
double m_maximum
Definition: jkqtedoubleedit.h:167
QToolButton * m_btnDown
Definition: jkqtedoubleedit.h:177
QColor errorBackgroundColor() const
background color used when an entry error occured (unparseable string)
virtual void contextMenuEvent(QContextMenuEvent *event)
QList< QPair< int, Qt::KeyboardModifiers > > m_keyEvents
used to store the key events
Definition: jkqtedoubleedit.h:154
void clearContextmenuActions()
remove all additional context menu QAction s
QRegExpValidator * m_validator
RegExp validator for this widget.
Definition: jkqtedoubleedit.h:160
double m_minimum
Definition: jkqtedoubleedit.h:168
QColor backgroundColor() const
color for the widget's background
bool checkMinimum() const
returns whether the range minimum is checked
QToolButton * m_btnUp
Definition: jkqtedoubleedit.h:176
void addKeyEvent(int key, Qt::KeyboardModifiers modifiers)
add a new Key Event
QRegExp m_regexp
regular expression used to match floating point numbers
Definition: jkqtedoubleedit.h:158
void setIncrement(double inc)
increment, when using the buttons or up/down keys
void valueChanged(double value)
emited whenever a entered value changed
QColor m_noIntegerBackgroundColor
Definition: jkqtedoubleedit.h:166
void setIntegerWidget(bool intWidget)
en-/disable integer edit mode (only integer numbers are allowed, i.e. no decimals!...
int m_decimals
Definition: jkqtedoubleedit.h:172
virtual void keyPressEvent(QKeyEvent *event)
void setErrorBackgroundColor(const QColor &color)
background color used when an entry error occured (unparseable string)
QColor noIntegerBackgroundColor() const
background color used when an setIntegerWidget(true), but the entered number is no integer
bool checkMaximum() const
returns whether the range maximum is checked
bool m_Integer
Definition: jkqtedoubleedit.h:174
void setMaximum(double value)
maximum of the value range, also calls setCheckMaximum(true)
void setNoIntegerBackgroundColor(const QColor &noIntegerBackgroundColor)
background color used when an setIntegerWidget(true), but the entered number is no integer
void setBackgroundColor(const QColor &color)
color for the widget's background
bool m_showUpDown
Definition: jkqtedoubleedit.h:175
void focusOut(double value)
emitted when the widget looses focus
JKQTEDoubleEdit(QWidget *parent)
class constructor
bool showUpDown() const
are the up/down buttons shown?
virtual void wheelEvent(QWheelEvent *event)
void setValue(double value)
set the value entered in this widget
bool m_checkMaximum
Definition: jkqtedoubleedit.h:170
void setShowUpDown(bool showUpDown)
sets whether up/down buttons are shown
this QLineEdit descendent implements a validating edit field that allows to enter floating point numb...
Definition: jkqtedoubleedit.h:58
bool m_checkMinimum
Definition: jkqtedoubleedit.h:171
bool isIntegerWidget() const
is integer edit mode en-/disable (only integer numbers are allowed, i.e. no decimals!...
QList< QAction * > m_contextmenuActions
list of additional actions for context menu
Definition: jkqtedoubleedit.h:156