Michaël Lemaire
4b85289ac7
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@431 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
29 lines
607 B
C++
29 lines
607 B
C++
#include "inputint.h"
|
|
|
|
#include <QLabel>
|
|
|
|
InputInt::InputInt(QWidget* form, QString label, int* value, int min, int max, int small_step, int large_step):
|
|
InputDouble(form, label, &_dvalue, (double)min, (double)max, (double)small_step, (double)large_step)
|
|
{
|
|
_value = value;
|
|
_dvalue = (double)(*value);
|
|
}
|
|
|
|
void InputInt::updatePreview()
|
|
{
|
|
((QLabel*)_preview)->setText(QString("%1").arg(_dvalue, 0, 'f', 0));
|
|
}
|
|
|
|
void InputInt::applyValue()
|
|
{
|
|
*_value = (int)_dvalue;
|
|
|
|
InputDouble::applyValue();
|
|
}
|
|
|
|
void InputInt::revert()
|
|
{
|
|
_dvalue = (double)(*_value);
|
|
|
|
InputDouble::revert();
|
|
}
|