diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-03-03 16:46:57 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-03-03 16:48:16 +0100 |
commit | aa5b5e237c4d8219a8cf9ce8c682bc4a0be4f483 (patch) | |
tree | 888d764c8fd79cc6d712f15a97d05eb380ab0167 /src/plugins/help | |
parent | bbf464fd2115eadab8bdf48609e349dc2ec9de5a (diff) | |
download | qt-creator-aa5b5e237c4d8219a8cf9ce8c682bc4a0be4f483.tar.gz |
Help: Fix leaking side bar widget and find placeholder.
Breakage introduced by d28dc2d98929cc3ba9e6b80b10751bb4534775da.
Reviewed-by: con
Diffstat (limited to 'src/plugins/help')
-rw-r--r-- | src/plugins/help/helpplugin.cpp | 22 | ||||
-rw-r--r-- | src/plugins/help/helpplugin.h | 1 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index a2bcbb90b9..520ae72255 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -128,6 +128,7 @@ HelpPlugin::HelpPlugin() : m_mode(0), m_core(0), m_centralWidget(0), + m_rightPaneSideBarWidget(0), m_helpViewerForSideBar(0), m_contentItem(0), m_indexItem(0), @@ -145,6 +146,7 @@ HelpPlugin::HelpPlugin() HelpPlugin::~HelpPlugin() { + delete m_rightPaneSideBarWidget; } bool HelpPlugin::initialize(const QStringList &arguments, QString *error) @@ -328,7 +330,9 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) if (QLayout *layout = m_centralWidget->layout()) { layout->setSpacing(0); - layout->addWidget(new Core::FindToolBarPlaceHolder(m_centralWidget)); + Core::FindToolBarPlaceHolder *fth = new Core::FindToolBarPlaceHolder(m_centralWidget); + fth->setObjectName(QLatin1String("HelpFindToolBarPlaceHolder")); + layout->addWidget(fth); } HelpIndexFilter *helpIndexFilter = new HelpIndexFilter(); @@ -526,7 +530,7 @@ void HelpPlugin::resetFilter() void HelpPlugin::createRightPaneContextViewer() { - if (m_helpViewerForSideBar) + if (m_rightPaneSideBarWidget) return; Utils::StyledBar *toolBar = new Utils::StyledBar(); @@ -553,21 +557,23 @@ void HelpPlugin::createRightPaneContextViewer() layout->addStretch(); layout->addWidget(toolButton(close)); - QWidget *rightPaneSideBar = new QWidget; - m_helpViewerForSideBar = new HelpViewer(qreal(0.0), rightPaneSideBar); + m_rightPaneSideBarWidget = new QWidget; + m_helpViewerForSideBar = new HelpViewer(qreal(0.0)); connect(m_helpViewerForSideBar, SIGNAL(openFindToolBar()), this, SLOT(openFindToolBar())); #if !defined(QT_NO_WEBKIT) m_helpViewerForSideBar->pageAction(QWebPage::OpenLinkInNewWindow)->setVisible(false); #endif - QVBoxLayout *rightPaneLayout = new QVBoxLayout(rightPaneSideBar); + QVBoxLayout *rightPaneLayout = new QVBoxLayout(m_rightPaneSideBarWidget); rightPaneLayout->setMargin(0); rightPaneLayout->setSpacing(0); rightPaneLayout->addWidget(toolBar); rightPaneLayout->addWidget(m_helpViewerForSideBar); - rightPaneLayout->addWidget(new Core::FindToolBarPlaceHolder(rightPaneSideBar)); - rightPaneSideBar->setFocusProxy(m_helpViewerForSideBar); + Core::FindToolBarPlaceHolder *fth = new Core::FindToolBarPlaceHolder(m_rightPaneSideBarWidget); + fth->setObjectName(QLatin1String("HelpRightPaneFindToolBarPlaceHolder")); + rightPaneLayout->addWidget(fth); + m_rightPaneSideBarWidget->setFocusProxy(m_helpViewerForSideBar); Aggregation::Aggregate *agg = new Aggregation::Aggregate(); agg->add(m_helpViewerForSideBar); @@ -832,7 +838,7 @@ HelpViewer* HelpPlugin::viewerForContextMode() } if (placeHolder && showSideBySide) { - RightPaneWidget::instance()->setWidget(m_helpViewerForSideBar->parentWidget()); + RightPaneWidget::instance()->setWidget(m_rightPaneSideBarWidget); RightPaneWidget::instance()->setShown(true); createRightPaneContextViewer(); return m_helpViewerForSideBar; diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h index c684178f76..4101afe0cf 100644 --- a/src/plugins/help/helpplugin.h +++ b/src/plugins/help/helpplugin.h @@ -141,6 +141,7 @@ private: HelpMode *m_mode; Core::ICore *m_core; CentralWidget *m_centralWidget; + QWidget *m_rightPaneSideBarWidget; HelpViewer *m_helpViewerForSideBar; Core::SideBarItem *m_contentItem; |