Added support for clearing the Expression Editor scene.

This commit is contained in:
dfighter1985 2014-09-17 19:27:06 +02:00
parent 6e499f2dba
commit 91a11938a2
2 changed files with 13 additions and 0 deletions

View file

@ -135,6 +135,9 @@ void ExpressionEditor::contextMenuEvent( QContextMenuEvent *e )
a = menu.addAction( "Save" );
connect( a, SIGNAL( triggered() ), this, SLOT( onSave() ) );
a = menu.addAction( "Clear" );
connect( a, SIGNAL( triggered() ), this, SLOT( onClear() ) );
}
menu.exec( e->globalPos() );
@ -334,6 +337,15 @@ void ExpressionEditor::onSave()
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 )
{

View file

@ -55,6 +55,7 @@ private Q_SLOTS:
void onSetRoot();
void onBuildExpression();
void onSave();
void onClear();
private:
void addExpression( const ExpressionInfo *info );