- fixed "closing mesh document" crash

This commit is contained in:
Guido Ranzuglia granzuglia 2016-09-22 06:02:55 +00:00
parent bf8a55f3be
commit 06cda96e60
5 changed files with 17 additions and 9 deletions

View File

@ -164,6 +164,7 @@ public:
void updateSharedContextDataAfterFilterExecution(int postcondmask,int fclasses,bool& newmeshcreated);
private slots:
void closeCurrentDocument();
//////////// Slot Menu File //////////////////////
void reload();
void reloadAllMesh();

View File

@ -76,12 +76,6 @@ MainWindow::MainWindow()
connect(windowMapper, SIGNAL(mapped(QWidget*)), this, SLOT(wrapSetActiveSubWindow(QWidget *)));
// Quando si passa da una finestra all'altra aggiorna lo stato delle toolbar e dei menu
connect(mdiarea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(switchCurrentContainer(QMdiSubWindow *)));
connect(mdiarea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(updateLayerDialog()));
connect(mdiarea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(updateMenus()));
connect(mdiarea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(updateWindowMenu()));
connect(mdiarea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(updateStdDialog()));
connect(mdiarea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(updateXMLStdDialog()));
connect(mdiarea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(updateDocumentScriptBindings()));
httpReq = new QNetworkAccessManager(this);
connect(httpReq, SIGNAL(finished(QNetworkReply*)), this, SLOT(connectionDone(QNetworkReply*)));

View File

@ -495,12 +495,12 @@ while(ii < meshDoc()->meshList.size())
a->setEnabled(false);
}
if(GLA())
GLArea* tmp = GLA();
if(tmp != NULL)
{
showLayerDlgAct->setChecked(layerDialog->isVisible());
showRasterAct->setEnabled(meshDoc()->rm() != 0);
showRasterAct->setChecked(GLA()->isRaster());
showRasterAct->setChecked(tmp->isRaster());
}
else
{
@ -2394,6 +2394,7 @@ void MainWindow::newProject(const QString& projName)
connect(&mvcont->meshDoc,SIGNAL(meshAdded(int)),this,SLOT(meshAdded(int)));
connect(&mvcont->meshDoc,SIGNAL(meshRemoved(int)),this,SLOT(meshRemoved(int)));
connect(&mvcont->meshDoc, SIGNAL(documentUpdated()), this, SLOT(documentUpdateRequested()));
connect(mvcont, SIGNAL(closingMultiViewerContainer()), this, SLOT(closeCurrentDocument()));
mdiarea->addSubWindow(mvcont);
connect(mvcont,SIGNAL(updateMainWindowMenus()),this,SLOT(updateMenus()));
connect(mvcont,SIGNAL(updateDocumentViewer()),this,SLOT(updateLayerDialog()));
@ -3744,4 +3745,12 @@ void MainWindow::switchCurrentContainer(QMdiSubWindow * subwin)
updateXMLStdDialog();
updateDocumentScriptBindings();
}
}
void MainWindow::closeCurrentDocument()
{
_currviewcontainer = NULL;
layerDialog->setVisible(false);
if (mdiarea != NULL)
mdiarea->closeActiveSubWindow();
}

View File

@ -356,7 +356,10 @@ void MultiViewer_Container::closeEvent( QCloseEvent *event )
}
if (close)
{
emit closingMultiViewerContainer();
event->accept();
}
else
event->ignore();
}

View File

@ -111,6 +111,7 @@ public:
signals:
void updateMainWindowMenus(); //updates the menus of the meshlab MainWindow
void updateDocumentViewer();
void closingMultiViewerContainer();
public slots: