Commit 85fac8d4 authored by Kai Koehne's avatar Kai Koehne
Browse files

QuickDesigner: Fix crash on exit

Make sure that the sidebar items are deleted before the core
(e.g. ICore::instance()) is deleted.

Task-number: QTCREATORBUG-3269
Reviewed-by: Thomas Hartmann
parent 2735694d
......@@ -670,6 +670,9 @@ void DesignModeWidget::setup()
connect(m_leftSideBar, SIGNAL(availableItemsChanged()), SLOT(updateAvailableSidebarItemsRight()));
connect(m_rightSideBar, SIGNAL(availableItemsChanged()), SLOT(updateAvailableSidebarItemsLeft()));
connect(Core::ICore::instance(), SIGNAL(coreAboutToClose()),
this, SLOT(deleteSidebarWidgets()));
m_fakeToolBar->setToolbarCreationFlags(Core::EditorToolBar::FlagsStandalone);
//m_fakeToolBar->addEditor(textEditor()); ### what does this mean?
m_fakeToolBar->setNavigationVisible(false);
......@@ -738,6 +741,14 @@ void DesignModeWidget::updateAvailableSidebarItemsLeft()
m_leftSideBar->setUnavailableItemIds(m_rightSideBar->unavailableItemIds());
}
void DesignModeWidget::deleteSidebarWidgets()
{
delete m_leftSideBar;
delete m_rightSideBar;
m_leftSideBar = 0;
m_rightSideBar = 0;
}
void DesignModeWidget::resizeEvent(QResizeEvent *event)
{
if (m_warningWidget)
......
......@@ -148,6 +148,8 @@ private slots:
void updateAvailableSidebarItemsLeft();
void updateAvailableSidebarItemsRight();
void deleteSidebarWidgets();
protected:
void resizeEvent(QResizeEvent *event);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment