diff options
| author | hjk <hjk@theqtcompany.com> | 2015-02-12 13:50:54 +0100 |
|---|---|---|
| committer | hjk <hjk@theqtcompany.com> | 2015-02-12 15:14:55 +0000 |
| commit | f1c5889e7753a4eea6f6dd4e9d94b5a25bf0e964 (patch) | |
| tree | 2be3e96f3f6a4d52e093e389d27dc4a97ed24849 /src/plugins/debugger/debuggersourcepathmappingwidget.cpp | |
| parent | 0eabe627864137220087cf4a25f79a57b21b5f54 (diff) | |
| download | qt-creator-f1c5889e7753a4eea6f6dd4e9d94b5a25bf0e964.tar.gz | |
Debugger: Some code modernization
Qt 5 signal/slot, a few auto.
Change-Id: Ia17f1b3dcd41dfe0a373c14e7c1d34d210d084f1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger/debuggersourcepathmappingwidget.cpp')
| -rw-r--r-- | src/plugins/debugger/debuggersourcepathmappingwidget.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 8fcb4a4567..637c2e5e0e 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -228,40 +228,41 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent m_treeView->setSelectionMode(QAbstractItemView::SingleSelection); m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows); m_treeView->setModel(m_model); - connect(m_treeView->selectionModel(), - SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), - SLOT(slotCurrentRowChanged(QModelIndex,QModelIndex))); + connect(m_treeView->selectionModel(), &QItemSelectionModel::currentRowChanged, + this, &DebuggerSourcePathMappingWidget::slotCurrentRowChanged); // Top list/Right part: Buttons. - QVBoxLayout *buttonLayout = new QVBoxLayout; + auto buttonLayout = new QVBoxLayout; buttonLayout->addWidget(m_addButton); buttonLayout->addWidget(m_addQtButton); m_addQtButton->setVisible(sizeof(qtBuildPaths) > 0); m_addQtButton->setToolTip(tr("Add a mapping for Qt's source folders " "when using an unpatched version of Qt.")); buttonLayout->addWidget(m_removeButton); - connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAdd())); - connect(m_addQtButton, SIGNAL(clicked()), this, SLOT(slotAddQt())); - - connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemove())); + connect(m_addButton, &QAbstractButton::clicked, + this, &DebuggerSourcePathMappingWidget::slotAdd); + connect(m_addQtButton, &QAbstractButton::clicked, + this, &DebuggerSourcePathMappingWidget::slotAddQt); + connect(m_removeButton, &QAbstractButton::clicked, + this, &DebuggerSourcePathMappingWidget::slotRemove); buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding)); // Assemble top - QHBoxLayout *treeHLayout = new QHBoxLayout; + auto treeHLayout = new QHBoxLayout; treeHLayout->addWidget(m_treeView); treeHLayout->addLayout(buttonLayout); // Edit part m_targetChooser->setExpectedKind(PathChooser::ExistingDirectory); m_targetChooser->setHistoryCompleter(QLatin1String("Debugger.MappingTarget.History")); - connect(m_sourceLineEdit, SIGNAL(textChanged(QString)), - this, SLOT(slotEditSourceFieldChanged())); - connect(m_targetChooser, SIGNAL(changed(QString)), - this, SLOT(slotEditTargetFieldChanged())); - QFormLayout *editLayout = new QFormLayout; + connect(m_sourceLineEdit, &QLineEdit::textChanged, + this, &DebuggerSourcePathMappingWidget::slotEditSourceFieldChanged); + connect(m_targetChooser, &PathChooser::changed, + this, &DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged); + auto editLayout = new QFormLayout; const QString sourceToolTip = tr("The source path contained in the " "debug information of the executable as reported by the debugger"); - QLabel *editSourceLabel = new QLabel(tr("&Source path:")); + auto editSourceLabel = new QLabel(tr("&Source path:")); editSourceLabel->setToolTip(sourceToolTip); m_sourceLineEdit->setToolTip(sourceToolTip); editSourceLabel->setBuddy(m_sourceLineEdit); @@ -269,7 +270,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent const QString targetToolTip = tr("The actual location of the source " "tree on the local machine"); - QLabel *editTargetLabel = new QLabel(tr("&Target path:")); + auto editTargetLabel = new QLabel(tr("&Target path:")); editTargetLabel->setToolTip(targetToolTip); editTargetLabel->setBuddy(m_targetChooser); m_targetChooser->setToolTip(targetToolTip); @@ -279,7 +280,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent chooser->addSupportedWidget(m_targetChooser->lineEdit()); // Main layout - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(treeHLayout); mainLayout->addLayout(editLayout); setLayout(mainLayout); |
