mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-23 07:16:15 +00:00
When changing the value of a node, change the size the node if needed.
This commit is contained in:
parent
535e0474ad
commit
1e91e006c4
3 changed files with 14 additions and 2 deletions
|
@ -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 )
|
||||||
|
|
|
@ -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++ )
|
||||||
|
|
|
@ -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; }
|
||||||
|
|
Loading…
Reference in a new issue