forked from qt-creator/qt-creator
Qt Designer: Fix a crash when closing form while building.
Task-number: QTCREATORBUG-1092 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtDesigner/QDesignerFormWindowInterface>
|
#include <QtDesigner/QDesignerFormWindowInterface>
|
||||||
|
#include <QtDesigner/QDesignerFormWindowManagerInterface>
|
||||||
#include <QtDesigner/QDesignerFormEditorInterface>
|
#include <QtDesigner/QDesignerFormEditorInterface>
|
||||||
|
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
@@ -53,6 +54,8 @@ FormWindowFile::FormWindowFile(QDesignerFormWindowInterface *form, QObject *pare
|
|||||||
m_mimeType(QLatin1String(Designer::Constants::FORM_MIMETYPE)),
|
m_mimeType(QLatin1String(Designer::Constants::FORM_MIMETYPE)),
|
||||||
m_formWindow(form)
|
m_formWindow(form)
|
||||||
{
|
{
|
||||||
|
connect(m_formWindow->core()->formWindowManager(), SIGNAL(formWindowRemoved(QDesignerFormWindowInterface*)),
|
||||||
|
this, SLOT(slotFormWindowRemoved(QDesignerFormWindowInterface*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FormWindowFile::save(const QString &name /*= QString()*/)
|
bool FormWindowFile::save(const QString &name /*= QString()*/)
|
||||||
@@ -192,5 +195,14 @@ QDesignerFormWindowInterface *FormWindowFile::formWindow() const
|
|||||||
return m_formWindow;
|
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 Internal
|
||||||
} // namespace Designer
|
} // namespace Designer
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
void setFileName(const QString &);
|
void setFileName(const QString &);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void slotFormWindowRemoved(QDesignerFormWindowInterface *w);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QString m_mimeType;
|
const QString m_mimeType;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user