Skip to content
Snippets Groups Projects
Commit 7ed80f16 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Qt Designer: Fix a crash when closing form while building.


Task-number: QTCREATORBUG-1092
Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
parent 5892049d
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@
#include <utils/qtcassert.h>
#include <QtDesigner/QDesignerFormWindowInterface>
#include <QtDesigner/QDesignerFormWindowManagerInterface>
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtGui/QMessageBox>
......@@ -53,6 +54,8 @@ FormWindowFile::FormWindowFile(QDesignerFormWindowInterface *form, QObject *pare
m_mimeType(QLatin1String(Designer::Constants::FORM_MIMETYPE)),
m_formWindow(form)
{
connect(m_formWindow->core()->formWindowManager(), SIGNAL(formWindowRemoved(QDesignerFormWindowInterface*)),
this, SLOT(slotFormWindowRemoved(QDesignerFormWindowInterface*)));
}
bool FormWindowFile::save(const QString &name /*= QString()*/)
......@@ -192,5 +195,14 @@ QDesignerFormWindowInterface *FormWindowFile::formWindow() const
return m_formWindow;
}
void FormWindowFile::slotFormWindowRemoved(QDesignerFormWindowInterface *w)
{
// Release formwindow as soon as the FormWindowManager removes
// as calls to isDirty() are triggered at arbitrary times
// while building.
if (w == m_formWindow)
m_formWindow = 0;
}
} // namespace Internal
} // namespace Designer
......@@ -78,6 +78,9 @@ signals:
public slots:
void setFileName(const QString &);
private slots:
void slotFormWindowRemoved(QDesignerFormWindowInterface *w);
private:
const QString m_mimeType;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment