Esempio n. 1
0
static void getOldExprForDimView(const KnobIPtr& knob, DimIdx dim, ViewIdx view, SetExpressionCommand::PerDimViewExprMap* ret)
{
    DimensionViewPair key = {dim, view};
    SetExpressionCommand::Expr& e = (*ret)[key];
    e.expression = knob->getExpression(dim, view);
    e.hasRetVar = knob->isExpressionUsingRetVariable(view, dim);
}
Esempio n. 2
0
void
KnobSpinBox::focusInEvent(QFocusEvent* e)
{
    _dnd->focusIn();
    SpinBox::focusInEvent(e);


    //Set the expression so the user can edit it easily
    KnobGuiPtr k = knob.lock();
    if (!k) {
        return;
    }
    KnobIPtr knob = k->getKnob();
    if (!knob) {
        return;
    }
    std::string expr = knob->getExpression(dimension, view);
    if ( expr.empty() ) {
        return;
    } else {
        QLineEdit::setText( QString::fromUtf8( expr.c_str() ) );
        setCursorPosition(expr.size() - 1);
    }
}