diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/coreplugin/rightpane.cpp | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/rightpane.h | 3 | ||||
-rw-r--r-- | src/plugins/help/helpplugin.cpp | 22 | ||||
-rw-r--r-- | src/plugins/help/helpplugin.h | 1 |
4 files changed, 18 insertions, 10 deletions
diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index e321d0787f..653eaea7d0 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -128,7 +128,7 @@ void RightPanePlaceHolder::currentModeChanged(Core::IMode *mode) RightPaneWidget *RightPaneWidget::m_instance = 0; RightPaneWidget::RightPaneWidget() - : m_shown(true), m_width(0), m_widget(0) + : m_shown(true), m_width(0) { m_instance = this; diff --git a/src/plugins/coreplugin/rightpane.h b/src/plugins/coreplugin/rightpane.h index edececd3e7..7f96d27c6a 100644 --- a/src/plugins/coreplugin/rightpane.h +++ b/src/plugins/coreplugin/rightpane.h @@ -37,6 +37,7 @@ #include "core_global.h" #include <QtGui/QWidget> +#include <QtCore/QPointer> QT_BEGIN_NAMESPACE class QSettings; @@ -93,7 +94,7 @@ private: void clearWidget(); bool m_shown; int m_width; - QWidget *m_widget; + QPointer<QWidget> m_widget; static RightPaneWidget *m_instance; }; 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; |