2012-01-05 18:39:17 +00:00
|
|
|
#include "baseinput.h"
|
|
|
|
|
|
|
|
BaseInput::BaseInput(QWidget* form, QString label):
|
|
|
|
QObject(form)
|
|
|
|
{
|
|
|
|
_label = new QLabel(label);
|
2012-04-14 15:52:16 +00:00
|
|
|
|
|
|
|
_label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
|
|
_label->setWordWrap(true);
|
2012-06-23 22:11:25 +00:00
|
|
|
|
|
|
|
_visibility_value = NULL;
|
|
|
|
_visible = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BaseInput::setVisibilityCondition(int* value, int condition)
|
|
|
|
{
|
|
|
|
_visibility_value = value;
|
|
|
|
_visibility_condition = condition;
|
2012-01-05 18:39:17 +00:00
|
|
|
}
|
2012-01-05 19:41:10 +00:00
|
|
|
|
2012-01-08 10:31:01 +00:00
|
|
|
void BaseInput::updatePreview()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-01-05 19:41:10 +00:00
|
|
|
void BaseInput::applyValue()
|
|
|
|
{
|
2012-01-08 10:31:01 +00:00
|
|
|
updatePreview();
|
2012-01-05 19:41:10 +00:00
|
|
|
emit(valueChanged());
|
|
|
|
}
|
2012-01-08 10:31:01 +00:00
|
|
|
|
|
|
|
void BaseInput::revert()
|
|
|
|
{
|
|
|
|
updatePreview();
|
|
|
|
}
|
2012-06-23 22:11:25 +00:00
|
|
|
|
|
|
|
void BaseInput::checkVisibility()
|
|
|
|
{
|
|
|
|
if (!_visibility_value || *_visibility_value == _visibility_condition)
|
|
|
|
{
|
|
|
|
if (not _visible)
|
|
|
|
{
|
|
|
|
_visible = true;
|
|
|
|
|
|
|
|
_label->show();
|
|
|
|
_preview->show();
|
|
|
|
_control->show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (_visible)
|
|
|
|
{
|
|
|
|
_visible = false;
|
|
|
|
|
|
|
|
_label->hide();
|
|
|
|
_preview->hide();
|
|
|
|
_control->hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|