Remove GUI Editor menu when unloading the plugin.

--HG--
branch : gsoc2014-dfighter
This commit is contained in:
dfighter1985 2014-06-08 18:30:09 +02:00
parent d7536332a6
commit fb4dc15fe7
2 changed files with 16 additions and 0 deletions

View file

@ -55,6 +55,7 @@ namespace GUIEditor
GUIEditorWindow::GUIEditorWindow(QWidget *parent) :
QMainWindow(parent)
{
menu = NULL;
m_ui.setupUi(this);
messageProcessor = new CEditorMessageProcessor;
m_undoStack = new QUndoStack(this);
@ -112,6 +113,8 @@ namespace GUIEditor
{
writeSettings();
removeMenus();
delete messageProcessor;
messageProcessor = NULL;
@ -382,8 +385,16 @@ namespace GUIEditor
a = new QAction( "Add Widget", this );
connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onAddWidgetClicked() ) );
m->addAction( a );
menu = m;
}
}
void GUIEditorWindow::removeMenus()
{
delete menu;
menu = NULL;
}
void GUIEditorWindow::readSettings()
{

View file

@ -26,6 +26,8 @@
class QtTreePropertyBrowser;
class QMenu;
namespace GUIEditor
{
@ -66,6 +68,7 @@ private Q_SLOTS:
private:
void createMenus();
void removeMenus();
void readSettings();
@ -88,6 +91,8 @@ private:
CPropBrowserCtrl browserCtrl;
QString currentProject;
QString currentProjectFile;
QMenu *menu;
};
}