mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-27 19:10:52 +00:00
Added support for clearing the Expression Editor scene.
This commit is contained in:
parent
49e8343345
commit
6badbe5112
2 changed files with 13 additions and 0 deletions
|
@ -135,6 +135,9 @@ void ExpressionEditor::contextMenuEvent( QContextMenuEvent *e )
|
||||||
|
|
||||||
a = menu.addAction( "Save" );
|
a = menu.addAction( "Save" );
|
||||||
connect( a, SIGNAL( triggered() ), this, SLOT( onSave() ) );
|
connect( a, SIGNAL( triggered() ), this, SLOT( onSave() ) );
|
||||||
|
|
||||||
|
a = menu.addAction( "Clear" );
|
||||||
|
connect( a, SIGNAL( triggered() ), this, SLOT( onClear() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.exec( e->globalPos() );
|
menu.exec( e->globalPos() );
|
||||||
|
@ -334,6 +337,15 @@ void ExpressionEditor::onSave()
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExpressionEditor::onClear()
|
||||||
|
{
|
||||||
|
m_scene->clear();
|
||||||
|
m_pvt->m_root = NULL;
|
||||||
|
m_nodeCount = 0;
|
||||||
|
m_selectionCount = 0;
|
||||||
|
m_result = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ExpressionEditor::addExpression( const ExpressionInfo *info )
|
void ExpressionEditor::addExpression( const ExpressionInfo *info )
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,6 +55,7 @@ private Q_SLOTS:
|
||||||
void onSetRoot();
|
void onSetRoot();
|
||||||
void onBuildExpression();
|
void onBuildExpression();
|
||||||
void onSave();
|
void onSave();
|
||||||
|
void onClear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addExpression( const ExpressionInfo *info );
|
void addExpression( const ExpressionInfo *info );
|
||||||
|
|
Loading…
Reference in a new issue