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

This commit is contained in:
dfighter1985 2014-09-16 15:31:06 +02:00
parent 535e0474ad
commit 1e91e006c4
3 changed files with 14 additions and 2 deletions

View file

@ -271,7 +271,6 @@ void ExpressionEditor::onChangeValue()
return; return;
node->setValue( newValue ); node->setValue( newValue );
node->update();
} }
void ExpressionEditor::addExpression( const ExpressionInfo *info ) 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 ) void ExpressionNode::mouseMoveEvent( QGraphicsSceneMouseEvent *e )
{ {
for( int i = 0; i < m_links.count(); i++ ) for( int i = 0; i < m_links.count(); i++ )

View file

@ -58,7 +58,7 @@ public:
void setVariable( bool b ){ m_variable = b; } void setVariable( bool b ){ m_variable = b; }
bool variable() const{ return m_variable; } 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; } QString getValue() const{ return m_value; }
bool isValue() const{ return m_isValue; } bool isValue() const{ return m_isValue; }