From ecbf4c7786093d440dd643bc2f57a564caa81441 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 2 Jun 2014 09:29:36 +0200 Subject: [PATCH] Debugger: Replace two data members by local variables Change-Id: I3db53587a752e6a62563b7130651e62fefd183c4 Reviewed-by: Christian Stenger --- .../debugger/debuggertooltipmanager.cpp | 25 +++++++++---------- src/plugins/debugger/debuggertooltipmanager.h | 2 -- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 9d4ea2bae7..2ff7459e58 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -573,13 +573,11 @@ static QString msgReleasedText() { return DebuggerToolTipWidget::tr("Previous"); DebuggerToolTipWidget::DebuggerToolTipWidget(QWidget *parent) : QWidget(parent), m_isPinned(false), - m_mainVBoxLayout(new QVBoxLayout), - m_toolBar(new QToolBar), m_toolButton(new QToolButton), m_titleLabel(new DraggableLabel), m_engineAcquired(false), m_creationDate(QDate::currentDate()), - m_treeView(new DebuggerToolTipTreeView), + m_treeView(new DebuggerToolTipTreeView(this)), m_defaultModel(new QStandardItemModel(this)) { const QIcon pinIcon(QLatin1String(":/debugger/images/pin.xpm")); @@ -596,20 +594,21 @@ DebuggerToolTipWidget::DebuggerToolTipWidget(QWidget *parent) : m_titleLabel->setMinimumWidth(40); // Ensure a draggable area even if text is empty. connect(m_titleLabel, SIGNAL(dragged(QPoint)), this, SLOT(slotDragged(QPoint))); - m_toolBar->setProperty("_q_custom_style_disabled", QVariant(true)); + QToolBar *toolBar = new QToolBar(this); + toolBar->setProperty("_q_custom_style_disabled", QVariant(true)); if (!pinIconSizes.isEmpty()) - m_toolBar->setIconSize(pinIconSizes.front()); - m_toolBar->addWidget(m_toolButton); - m_toolBar->addWidget(m_titleLabel); - m_toolBar->addWidget(copyButton); + toolBar->setIconSize(pinIconSizes.front()); + toolBar->addWidget(m_toolButton); + toolBar->addWidget(m_titleLabel); + toolBar->addWidget(copyButton); m_treeView->setFocusPolicy(Qt::NoFocus); - m_mainVBoxLayout->setSizeConstraint(QLayout::SetFixedSize); - m_mainVBoxLayout->setContentsMargins(0, 0, 0, 0); - m_mainVBoxLayout->addWidget(m_toolBar); - m_mainVBoxLayout->addWidget(m_treeView); - setLayout(m_mainVBoxLayout); + QVBoxLayout *mainLayout = new QVBoxLayout(this); + mainLayout->setSizeConstraint(QLayout::SetFixedSize); + mainLayout->setContentsMargins(0, 0, 0, 0); + mainLayout->addWidget(toolBar); + mainLayout->addWidget(m_treeView); } bool DebuggerToolTipWidget::matches(const QString &fileName, diff --git a/src/plugins/debugger/debuggertooltipmanager.h b/src/plugins/debugger/debuggertooltipmanager.h index 81b22171ec..a5bac343a5 100644 --- a/src/plugins/debugger/debuggertooltipmanager.h +++ b/src/plugins/debugger/debuggertooltipmanager.h @@ -132,8 +132,6 @@ private slots: private: bool m_isPinned; - QVBoxLayout *m_mainVBoxLayout; - QToolBar *m_toolBar; QToolButton *m_toolButton; private: -- GitLab