Commit ecbf4c77 authored by hjk's avatar hjk

Debugger: Replace two data members by local variables

Change-Id: I3db53587a752e6a62563b7130651e62fefd183c4
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 37ab6e6d
...@@ -573,13 +573,11 @@ static QString msgReleasedText() { return DebuggerToolTipWidget::tr("Previous"); ...@@ -573,13 +573,11 @@ static QString msgReleasedText() { return DebuggerToolTipWidget::tr("Previous");
DebuggerToolTipWidget::DebuggerToolTipWidget(QWidget *parent) : DebuggerToolTipWidget::DebuggerToolTipWidget(QWidget *parent) :
QWidget(parent), QWidget(parent),
m_isPinned(false), m_isPinned(false),
m_mainVBoxLayout(new QVBoxLayout),
m_toolBar(new QToolBar),
m_toolButton(new QToolButton), m_toolButton(new QToolButton),
m_titleLabel(new DraggableLabel), m_titleLabel(new DraggableLabel),
m_engineAcquired(false), m_engineAcquired(false),
m_creationDate(QDate::currentDate()), m_creationDate(QDate::currentDate()),
m_treeView(new DebuggerToolTipTreeView), m_treeView(new DebuggerToolTipTreeView(this)),
m_defaultModel(new QStandardItemModel(this)) m_defaultModel(new QStandardItemModel(this))
{ {
const QIcon pinIcon(QLatin1String(":/debugger/images/pin.xpm")); const QIcon pinIcon(QLatin1String(":/debugger/images/pin.xpm"));
...@@ -596,20 +594,21 @@ DebuggerToolTipWidget::DebuggerToolTipWidget(QWidget *parent) : ...@@ -596,20 +594,21 @@ DebuggerToolTipWidget::DebuggerToolTipWidget(QWidget *parent) :
m_titleLabel->setMinimumWidth(40); // Ensure a draggable area even if text is empty. m_titleLabel->setMinimumWidth(40); // Ensure a draggable area even if text is empty.
connect(m_titleLabel, SIGNAL(dragged(QPoint)), this, SLOT(slotDragged(QPoint))); 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()) if (!pinIconSizes.isEmpty())
m_toolBar->setIconSize(pinIconSizes.front()); toolBar->setIconSize(pinIconSizes.front());
m_toolBar->addWidget(m_toolButton); toolBar->addWidget(m_toolButton);
m_toolBar->addWidget(m_titleLabel); toolBar->addWidget(m_titleLabel);
m_toolBar->addWidget(copyButton); toolBar->addWidget(copyButton);
m_treeView->setFocusPolicy(Qt::NoFocus); m_treeView->setFocusPolicy(Qt::NoFocus);
m_mainVBoxLayout->setSizeConstraint(QLayout::SetFixedSize); QVBoxLayout *mainLayout = new QVBoxLayout(this);
m_mainVBoxLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setSizeConstraint(QLayout::SetFixedSize);
m_mainVBoxLayout->addWidget(m_toolBar); mainLayout->setContentsMargins(0, 0, 0, 0);
m_mainVBoxLayout->addWidget(m_treeView); mainLayout->addWidget(toolBar);
setLayout(m_mainVBoxLayout); mainLayout->addWidget(m_treeView);
} }
bool DebuggerToolTipWidget::matches(const QString &fileName, bool DebuggerToolTipWidget::matches(const QString &fileName,
......
...@@ -132,8 +132,6 @@ private slots: ...@@ -132,8 +132,6 @@ private slots:
private: private:
bool m_isPinned; bool m_isPinned;
QVBoxLayout *m_mainVBoxLayout;
QToolBar *m_toolBar;
QToolButton *m_toolButton; QToolButton *m_toolButton;
private: private:
......
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