Michaël Lemaire
323dc8122c
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@357 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
29 lines
640 B
C++
29 lines
640 B
C++
#include "inputenum.h"
|
|
|
|
#include <QLabel>
|
|
#include <QComboBox>
|
|
|
|
InputEnum::InputEnum(QWidget* form, QString label, int* value, const QStringList& values) : BaseInput(form, label)
|
|
{
|
|
_value = value;
|
|
|
|
_preview = new QWidget(form);
|
|
_control = new QComboBox(form);
|
|
((QComboBox*)_control)->addItems(values);
|
|
|
|
connect(_control, SIGNAL(currentIndexChanged(int)), this, SLOT(applyValue()));
|
|
}
|
|
|
|
void InputEnum::applyValue()
|
|
{
|
|
*_value = ((QComboBox*)_control)->currentIndex();
|
|
|
|
BaseInput::applyValue();
|
|
}
|
|
|
|
void InputEnum::revert()
|
|
{
|
|
((QComboBox*)_control)->setCurrentIndex(*_value);
|
|
|
|
BaseInput::revert();
|
|
}
|