KDWinUtils
Helper library for MFC to Qt migration
|
The KNumber< T > class is used to replace DDX_Text data exchange for numeric types. More...
#include <knumber.h>
Public Types | |
using | Type = T |
using | value_type = T |
Public Member Functions | |
KNumber (T value) | |
operator T () const | |
KNumber< T > & | operator= (const T &value) |
void | setValidator (QValidator *validator) |
void | setWidget (QWidget *label) |
QWidget * | widget () const |
The KNumber< T > class is used to replace DDX_Text data exchange for numeric types.
This class handles widget that displays a numeric type. It is a proxy for the widget, and can be used to set and get the value. There are no MFC equivalent for this class, as an int, float, double... are used in MFC to represent the state of the widget. Only in the case of a numeric types.
It can be used with a QLineEdit, a QComboBox or a QLabel.
using KNumber< T >::Type = T |
using KNumber< T >::value_type = T |
Constructs a KNumber with a default value.
|
inline |
Returns the current value of the widget.
Sets a new value on the widget, the value will be transformed into text.
|
inline |
Add a validator to the widget, particularly useful for handling DDV routines.
|
inline |
Sets the widget the class is proxying.
|
inline |
Returns the underlying widget the class is proxying.