Example #1
0
void FloatProperty::textEdited()
{
    float newValue = _lineEdit->text().toFloat();
    if (newValue != _value) {
        if (!_setter(newValue))
            _lineEdit->setText(QString::number(_value));
        else
            _value = newValue;
    }
}
Example #2
0
void StringProperty::textEdited()
{
    std::string value = _lineEdit->text().toStdString();
    if (value != _value) {
        if (!_setter(value))
            _lineEdit->setText(QString::fromStdString(_value));
        else
            _value = value;
    }
}
Example #3
0
void VectorProperty::changeRgb()
{
    Vec3f color;
    for (int i = 0; i < 3; ++i)
        color[i] = _lineEdits[i]->text().toFloat();

    if (_setter(color)) {
        _value = color;
        _colorPicker->changeColor(_isAbsorption ? std::exp(-color) : color);
    }
}
Example #4
0
void ListProperty::changeActive(int idx)
{
    if (idx == _index)
        return;

    if (_setter(_list[idx], idx)) {
        _index = idx;
        _value = _list[idx];
    } else {
        _comboBox->setCurrentIndex(_index);
    }
}
Example #5
0
void VectorProperty::changeRgb(Vec3f color)
{
    if (_isAbsorption)
        color = -std::log(color);

    if (_setter(color)) {
        _value = color;

        for (int i = 0; i < 3; ++i) {
            setText(_lineEdits[i], QString::number(color[i]));
        }
    }
}
Example #6
0
bool DataProperty::setValue(DataObject* obj, const DataValue& value) const
{
	return _setter && _setter(obj, const_cast<DataProperty*>(this), DataValue(value).convertTo(_type));
}
Example #7
0
bool CProperty::Set(const string &value) const {
    return _setter(value);
}