When changing the value of a node, change the size the node if needed.

--HG--
branch : dfighter-tools
This commit is contained in:
dfighter1985 2014-09-16 15:31:06 +02:00
parent f0e78b5fbb
commit 5e91c2f374
3 changed files with 14 additions and 2 deletions

View file

@ -271,7 +271,6 @@ void ExpressionEditor::onChangeValue()
return;
node->setValue( newValue );
node->update();
}
void ExpressionEditor::addExpression( const ExpressionInfo *info )

View file

@ -257,6 +257,19 @@ void ExpressionNode::setSlotNames( const QList< QString > &l )
}
}
void ExpressionNode::setValue( const QString &value )
{
m_value = value;
int c = m_value.count();
if( c < 15 )
m_w = 100.0;
else
m_w = m_w + ( 100.0 / 15.0 ) * ( c - 15.0 );
update();
}
void ExpressionNode::mouseMoveEvent( QGraphicsSceneMouseEvent *e )
{
for( int i = 0; i < m_links.count(); i++ )

View file

@ -58,7 +58,7 @@ public:
void setVariable( bool b ){ m_variable = b; }
bool variable() const{ return m_variable; }
void setValue( const QString &value ){ m_value = value; }
void setValue( const QString &value );
QString getValue() const{ return m_value; }
bool isValue() const{ return m_isValue; }