summaryrefslogtreecommitdiffstats
path: root/tools/designer
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@nokia.com>2012-08-13 13:49:23 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-08-31 12:47:18 (GMT)
commit4b6d972d805c9e0c2c46e82871229751280d43ee (patch)
treea55475eb4d33a822e729873fc135f2f6eb0d7782 /tools/designer
parent54334ca2e51ec43a07872c8b5861e5900d6b6cbb (diff)
downloadQt-4b6d972d805c9e0c2c46e82871229751280d43ee.zip
Qt-4b6d972d805c9e0c2c46e82871229751280d43ee.tar.gz
Qt-4b6d972d805c9e0c2c46e82871229751280d43ee.tar.bz2
Make sure the parent widget still exists.
It may happen that InPlaceWidgetHelper's destructor is called after parent widget destructor. Now inside InPlaceWidgetHelper's destructor we check if parent widget still exists. Task-number: QTCREATORBUG-7684 Change-Id: I4c9ecbfae7323fd95345ccabc113218a7011ebe8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> (cherry picked from commit aad795575646b37b5c531cb6314eaa049e90e076)
Diffstat (limited to 'tools/designer')
-rw-r--r--tools/designer/src/components/taskmenu/inplace_widget_helper.cpp3
-rw-r--r--tools/designer/src/components/taskmenu/inplace_widget_helper.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/designer/src/components/taskmenu/inplace_widget_helper.cpp b/tools/designer/src/components/taskmenu/inplace_widget_helper.cpp
index fc34b98..d71d265 100644
--- a/tools/designer/src/components/taskmenu/inplace_widget_helper.cpp
+++ b/tools/designer/src/components/taskmenu/inplace_widget_helper.cpp
@@ -65,7 +65,8 @@ namespace qdesigner_internal {
InPlaceWidgetHelper::~InPlaceWidgetHelper()
{
- m_parentWidget->setAttribute(Qt::WA_NoChildEventsForParent, m_noChildEvent);
+ if (m_parentWidget)
+ m_parentWidget->setAttribute(Qt::WA_NoChildEventsForParent, m_noChildEvent);
}
Qt::Alignment InPlaceWidgetHelper::alignment() const {
diff --git a/tools/designer/src/components/taskmenu/inplace_widget_helper.h b/tools/designer/src/components/taskmenu/inplace_widget_helper.h
index de13a23..972b5a7 100644
--- a/tools/designer/src/components/taskmenu/inplace_widget_helper.h
+++ b/tools/designer/src/components/taskmenu/inplace_widget_helper.h
@@ -46,6 +46,7 @@
#include <QtCore/QObject>
#include <QtCore/QPoint>
#include <QtCore/QSize>
+#include <QtCore/QPointer>
#include <qglobal.h>
QT_BEGIN_NAMESPACE
@@ -75,7 +76,7 @@ namespace qdesigner_internal {
Qt::Alignment alignment() const;
private:
QWidget *m_editorWidget;
- QWidget *m_parentWidget;
+ QPointer<QWidget> m_parentWidget;
const bool m_noChildEvent;
QPoint m_posOffset;
QSize m_sizeOffset;