mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 01:26:30 +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;
|
||||
|
||||
node->setValue( newValue );
|
||||
node->update();
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
for( int i = 0; i < m_links.count(); i++ )
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue