Commit f1c5889e authored by hjk's avatar hjk
Browse files

Debugger: Some code modernization



Qt 5 signal/slot, a few auto.

Change-Id: Ia17f1b3dcd41dfe0a373c14e7c1d34d210d084f1
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 0eabe627
......@@ -144,7 +144,7 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
{
setWindowTitle(tr("Edit Breakpoint Properties"));
QGroupBox *groupBoxBasic = new QGroupBox(tr("Basic"), this);
auto groupBoxBasic = new QGroupBox(tr("Basic"), this);
// Match BreakpointType (omitting unknown type).
QStringList types;
......@@ -195,7 +195,7 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
m_labelFunction = new QLabel(tr("Fun&ction:"), groupBoxBasic);
m_labelFunction->setBuddy(m_lineEditFunction);
QGroupBox *groupBoxAdvanced = new QGroupBox(tr("Advanced"), this);
auto groupBoxAdvanced = new QGroupBox(tr("Advanced"), this);
m_checkBoxTracepoint = new QCheckBox(groupBoxAdvanced);
m_labelTracepoint = new QLabel(tr("T&racepoint only:"), groupBoxAdvanced);
......@@ -279,7 +279,7 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
}
}
QFormLayout *basicLayout = new QFormLayout(groupBoxBasic);
auto basicLayout = new QFormLayout(groupBoxBasic);
basicLayout->addRow(m_labelType, m_comboBoxType);
basicLayout->addRow(m_labelFileName, m_pathChooserFileName);
basicLayout->addRow(m_labelLineNumber, m_lineEditLineNumber);
......@@ -289,7 +289,7 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
basicLayout->addRow(m_labelFunction, m_lineEditFunction);
basicLayout->addRow(m_labelOneShot, m_checkBoxOneShot);
QFormLayout *advancedLeftLayout = new QFormLayout();
auto advancedLeftLayout = new QFormLayout();
advancedLeftLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
advancedLeftLayout->addRow(m_labelCondition, m_lineEditCondition);
advancedLeftLayout->addRow(m_labelIgnoreCount, m_spinBoxIgnoreCount);
......@@ -297,18 +297,18 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
advancedLeftLayout->addRow(m_labelUseFullPath, m_comboBoxPathUsage);
advancedLeftLayout->addRow(m_labelModule, m_lineEditModule);
QFormLayout *advancedRightLayout = new QFormLayout();
auto advancedRightLayout = new QFormLayout();
advancedRightLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
advancedRightLayout->addRow(m_labelCommands, m_textEditCommands);
advancedRightLayout->addRow(m_labelTracepoint, m_checkBoxTracepoint);
advancedRightLayout->addRow(m_labelMessage, m_lineEditMessage);
QHBoxLayout *horizontalLayout = new QHBoxLayout(groupBoxAdvanced);
auto horizontalLayout = new QHBoxLayout(groupBoxAdvanced);
horizontalLayout->addLayout(advancedLeftLayout);
horizontalLayout->addSpacing(15);
horizontalLayout->addLayout(advancedRightLayout);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addWidget(groupBoxBasic);
verticalLayout->addSpacing(10);
verticalLayout->addWidget(groupBoxAdvanced);
......@@ -316,9 +316,10 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
verticalLayout->addWidget(m_buttonBox);
verticalLayout->setStretchFactor(groupBoxAdvanced, 10);
connect(m_comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int)));
connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(m_comboBoxType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
this, &BreakpointDialog::typeChanged);
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
void BreakpointDialog::setType(BreakpointType type)
......@@ -654,18 +655,18 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(QWidget *parent) :
m_buttonBox = new QDialogButtonBox(this);
m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
QFormLayout *formLayout = new QFormLayout;
auto formLayout = new QFormLayout;
if (currentEngine()->hasCapability(BreakConditionCapability))
formLayout->addRow(tr("&Condition:"), m_lineEditCondition);
formLayout->addRow(tr("&Ignore count:"), m_spinBoxIgnoreCount);
formLayout->addRow(tr("&Thread specification:"), m_lineEditThreadSpec);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(m_buttonBox);
QObject::connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
QObject::connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
///////////////////////////////////////////////////////////////////////
......@@ -678,8 +679,8 @@ BreakTreeView::BreakTreeView()
{
setWindowIcon(QIcon(QLatin1String(":/debugger/images/debugger_breakpoints.png")));
setSelectionMode(QAbstractItemView::ExtendedSelection);
connect(action(UseAddressInBreakpointsView),
SIGNAL(toggled(bool)), SLOT(showAddressColumn(bool)));
connect(action(UseAddressInBreakpointsView), &QAction::toggled,
this, &BreakTreeView::showAddressColumn);
}
void BreakTreeView::showAddressColumn(bool on)
......
......@@ -340,17 +340,22 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp) :
m_watchPointY(0),
m_ignoreCdbOutput(false)
{
connect(action(OperateByInstruction), SIGNAL(triggered(bool)),
this, SLOT(operateByInstructionTriggered(bool)));
connect(action(VerboseLog), SIGNAL(triggered(bool)),
this, SLOT(verboseLogTriggered(bool)));
connect(action(CreateFullBacktrace), SIGNAL(triggered()),
this, SLOT(createFullBacktrace()));
setObjectName(QLatin1String("CdbEngine"));
connect(&m_process, SIGNAL(finished(int)), this, SLOT(processFinished()));
connect(&m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError()));
connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readyReadStandardOut()));
connect(&m_process, SIGNAL(readyReadStandardError()), this, SLOT(readyReadStandardOut()));
connect(action(OperateByInstruction), &QAction::triggered,
this, &CdbEngine::operateByInstructionTriggered);
connect(action(VerboseLog), &QAction::triggered,
this, &CdbEngine::verboseLogTriggered);
connect(action(CreateFullBacktrace), &QAction::triggered,
this, &CdbEngine::createFullBacktrace);
connect(&m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished),
this, &CdbEngine::processFinished);
connect(&m_process, static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, &CdbEngine::processError);
connect(&m_process, &QProcess::readyReadStandardOutput,
this, &CdbEngine::readyReadStandardOut);
connect(&m_process, &QProcess::readyReadStandardError,
this, &CdbEngine::readyReadStandardOut);
}
void CdbEngine::init()
......
......@@ -230,8 +230,8 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
Utils::SavedAction *registerAction = action(RegisterForPostMortem);
m_group->insert(registerAction,
checkBoxRegisterForPostMortem);
connect(registerAction, SIGNAL(toggled(bool)),
checkBoxRegisterForPostMortem, SLOT(setChecked(bool)));
connect(registerAction, &QAction::toggled,
checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
} else {
checkBoxRegisterForPostMortem->setVisible(false);
}
......
......@@ -282,11 +282,11 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
"If empty, $SYSROOT/usr/lib/debug will be chosen."));
d->debuginfoPathChooser->setHistoryCompleter(QLatin1String("Debugger.DebugLocation.History"));
QFrame *line = new QFrame(this);
auto line = new QFrame(this);
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
QFrame *line2 = new QFrame(this);
auto line2 = new QFrame(this);
line2->setFrameShape(QFrame::HLine);
line2->setFrameShadow(QFrame::Sunken);
......@@ -296,7 +296,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
d->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
QFormLayout *formLayout = new QFormLayout();
auto formLayout = new QFormLayout();
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
formLayout->addRow(tr("&Kit:"), d->kitChooser);
formLayout->addRow(d->serverPortLabel, d->serverPortSpinBox);
......@@ -311,17 +311,18 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
formLayout->addRow(line2);
formLayout->addRow(tr("&Recent:"), d->historyComboBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
verticalLayout->addStretch();
verticalLayout->addWidget(line);
verticalLayout->addWidget(d->buttonBox);
connect(d->localExecutablePathChooser, SIGNAL(changed(QString)), SLOT(updateState()));
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(d->historyComboBox, SIGNAL(currentIndexChanged(int)),
SLOT(historyIndexChanged(int)));
connect(d->localExecutablePathChooser, &PathChooser::changed,
this, &StartApplicationDialog::updateState);
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(d->historyComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &StartApplicationDialog::historyIndexChanged);
updateState();
}
......@@ -493,20 +494,20 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
d->portSpinBox->setMaximum(65535);
d->portSpinBox->setValue(3768);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
auto buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
QFormLayout *formLayout = new QFormLayout();
auto formLayout = new QFormLayout();
formLayout->addRow(tr("Kit:"), d->kitChooser);
formLayout->addRow(tr("&Port:"), d->portSpinBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
AttachToQmlPortDialog::~AttachToQmlPortDialog()
......@@ -567,34 +568,38 @@ StartRemoteCdbDialog::StartRemoteCdbDialog(QWidget *parent) :
setWindowTitle(tr("Start a CDB Remote Session"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QGroupBox *groupBox = new QGroupBox;
auto groupBox = new QGroupBox;
QLabel *helpLabel = new QLabel(cdbRemoteHelp());
auto helpLabel = new QLabel(cdbRemoteHelp());
helpLabel->setWordWrap(true);
helpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
QLabel *label = new QLabel(tr("&Connection:"));
auto label = new QLabel(tr("&Connection:"));
label->setBuddy(m_lineEdit);
m_lineEdit->setMinimumWidth(400);
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
auto box = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QFormLayout *formLayout = new QFormLayout;
auto formLayout = new QFormLayout;
formLayout->addRow(helpLabel);
formLayout->addRow(label, m_lineEdit);
groupBox->setLayout(formLayout);
QVBoxLayout *vLayout = new QVBoxLayout(this);
auto vLayout = new QVBoxLayout(this);
vLayout->addWidget(groupBox);
vLayout->addWidget(box);
m_okButton = box->button(QDialogButtonBox::Ok);
m_okButton->setEnabled(false);
connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)));
connect(m_lineEdit, SIGNAL(returnPressed()), m_okButton, SLOT(animateClick()));
connect(box, SIGNAL(accepted()), this, SLOT(accept()));
connect(box, SIGNAL(rejected()), this, SLOT(reject()));
connect(m_lineEdit, &QLineEdit::textChanged,
this, &StartRemoteCdbDialog::textChanged);
connect(m_lineEdit, &QLineEdit::returnPressed,
[this] { m_okButton->animateClick(); });
connect(box, &QDialogButtonBox::accepted,
this, &StartRemoteCdbDialog::accept);
connect(box, &QDialogButtonBox::rejected,
this, &QDialog::reject);
}
void StartRemoteCdbDialog::accept()
......@@ -636,18 +641,20 @@ AddressDialog::AddressDialog(QWidget *parent) :
{
setWindowTitle(tr("Select Start Address"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QHBoxLayout *hLayout = new QHBoxLayout;
auto hLayout = new QHBoxLayout;
hLayout->addWidget(new QLabel(tr("Enter an address:") + QLatin1Char(' ')));
hLayout->addWidget(m_lineEdit);
QVBoxLayout *vLayout = new QVBoxLayout;
auto vLayout = new QVBoxLayout;
vLayout->addLayout(hLayout);
vLayout->addWidget(m_box);
setLayout(vLayout);
connect(m_box, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_box, SIGNAL(rejected()), this, SLOT(reject()));
connect(m_lineEdit, SIGNAL(returnPressed()), this, SLOT(accept()));
connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
connect(m_box, &QDialogButtonBox::accepted, this, &AddressDialog::accept);
connect(m_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_lineEdit, &QLineEdit::returnPressed, this, &AddressDialog::accept);
connect(m_lineEdit, &QLineEdit::textChanged, this, &AddressDialog::textChanged);
setOkButtonEnabled(false);
}
......@@ -732,20 +739,20 @@ StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent)
d->buttonBox = new QDialogButtonBox(this);
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
QFormLayout *formLayout = new QFormLayout();
auto formLayout = new QFormLayout();
formLayout->addRow(tr("&Host:"), d->host);
formLayout->addRow(tr("&Username:"), d->username);
formLayout->addRow(tr("&Password:"), d->password);
formLayout->addRow(tr("&Engine path:"), d->enginePath);
formLayout->addRow(tr("&Inferior path:"), d->inferiorPath);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
verticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
verticalLayout->addWidget(d->buttonBox);
connect(d->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(d->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
StartRemoteEngineDialog::~StartRemoteEngineDialog()
......
......@@ -177,10 +177,10 @@ public:
m_memoryAgent(engine),
m_isStateDebugging(false)
{
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
connect(action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
SLOT(reloadDisassembly()));
connect(&m_locationTimer, &QTimer::timeout,
this, &DebuggerEnginePrivate::resetLocation);
connect(action(IntelFlavor), &Utils::SavedAction::valueChanged,
this, &DebuggerEnginePrivate::reloadDisassembly);
connect(action(OperateNativeMixed), &QAction::triggered,
engine, &DebuggerEngine::reloadFullStack);
......@@ -526,7 +526,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_progress.setProgressRange(0, 1000);
FutureProgress *fp = ProgressManager::addTask(d->m_progress.future(),
tr("Launching Debugger"), "Debugger.Launcher");
connect(fp, SIGNAL(canceled()), this, SLOT(quitDebugger()));
connect(fp, &FutureProgress::canceled, this, &DebuggerEngine::quitDebugger);
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
d->m_progress.reportStarted();
......
......@@ -299,8 +299,8 @@ void DebuggerMainWindowPrivate::createViewsMenuItems()
QAction *openMemoryEditorAction = new QAction(this);
openMemoryEditorAction->setText(tr("Memory..."));
connect(openMemoryEditorAction, SIGNAL(triggered()),
SLOT(openMemoryEditor()));
connect(openMemoryEditorAction, &QAction::triggered,
this, &DebuggerMainWindowPrivate::openMemoryEditor);
// Add menu items
Command *cmd = 0;
......@@ -440,17 +440,17 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
connect(autoHideTitleBarsAction(), SIGNAL(triggered()),
d, SLOT(updateDockWidgetSettings()));
QBoxLayout *editorHolderLayout = new QVBoxLayout;
auto editorHolderLayout = new QVBoxLayout;
editorHolderLayout->setMargin(0);
editorHolderLayout->setSpacing(0);
QWidget *editorAndFindWidget = new QWidget;
auto editorAndFindWidget = new QWidget;
editorAndFindWidget->setLayout(editorHolderLayout);
auto editorManagerPlaceHolder = new EditorManagerPlaceHolder(mode);
editorHolderLayout->addWidget(editorManagerPlaceHolder);
editorHolderLayout->addWidget(new FindToolBarPlaceHolder(editorAndFindWidget));
MiniSplitter *documentAndRightPane = new MiniSplitter;
auto documentAndRightPane = new MiniSplitter;
documentAndRightPane->addWidget(editorAndFindWidget);
documentAndRightPane->addWidget(new RightPanePlaceHolder(mode));
documentAndRightPane->setStretchFactor(0, 1);
......@@ -462,18 +462,18 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
hackyName.replace(QLatin1Char('&'), QString());
d->m_viewButton->setText(hackyName);
Utils::StyledBar *debugToolBar = new Utils::StyledBar;
auto debugToolBar = new Utils::StyledBar;
debugToolBar->setProperty("topBorder", true);
QHBoxLayout *debugToolBarLayout = new QHBoxLayout(debugToolBar);
auto debugToolBarLayout = new QHBoxLayout(debugToolBar);
debugToolBarLayout->setMargin(0);
debugToolBarLayout->setSpacing(0);
debugToolBarLayout->addWidget(d->m_debugToolBar);
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
debugToolBarLayout->addWidget(d->m_viewButton);
connect(d->m_viewButton, SIGNAL(clicked()), this, SLOT(showViewsMenu()));
connect(d->m_viewButton, &QAbstractButton::clicked, this, &DebuggerMainWindow::showViewsMenu);
QDockWidget *dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
auto dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
dock->setObjectName(QLatin1String("Debugger Toolbar"));
dock->setWidget(debugToolBar);
dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
......@@ -483,10 +483,10 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
addDockWidget(Qt::BottomDockWidgetArea, dock);
setToolBarDockWidget(dock);
QWidget *centralWidget = new QWidget;
auto centralWidget = new QWidget;
setCentralWidget(centralWidget);
QVBoxLayout *centralLayout = new QVBoxLayout(centralWidget);
auto centralLayout = new QVBoxLayout(centralWidget);
centralWidget->setLayout(centralLayout);
centralLayout->setMargin(0);
centralLayout->setSpacing(0);
......@@ -495,9 +495,9 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
centralLayout->setStretch(1, 0);
// Right-side window with editor, output etc.
MiniSplitter *mainWindowSplitter = new MiniSplitter;
auto mainWindowSplitter = new MiniSplitter;
mainWindowSplitter->addWidget(this);
QWidget *outputPane = new OutputPanePlaceHolder(mode, mainWindowSplitter);
auto outputPane = new OutputPanePlaceHolder(mode, mainWindowSplitter);
outputPane->setObjectName(QLatin1String("DebuggerOutputPanePlaceHolder"));
mainWindowSplitter->addWidget(outputPane);
mainWindowSplitter->setStretchFactor(0, 10);
......@@ -505,7 +505,7 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
mainWindowSplitter->setOrientation(Qt::Vertical);
// Navigation and right-side window.
MiniSplitter *splitter = new MiniSplitter;
auto splitter = new MiniSplitter;
splitter->setFocusProxy(editorManagerPlaceHolder);
splitter->addWidget(new NavigationWidgetPlaceHolder(mode));
splitter->addWidget(mainWindowSplitter);
......
......@@ -3398,7 +3398,7 @@ void DebuggerPluginPrivate::testProjectEvaluated()
QVERIFY(!fileName.isEmpty());
qWarning("Project %s loaded", qPrintable(fileName));
connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)),
SLOT(testProjectBuilt(bool)));
this, SLOT(testProjectBuilt(bool)));
ProjectExplorerPlugin::buildProject(m_testProject);
}
......
......@@ -122,18 +122,18 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
SLOT(useQmlDebuggerToggled(bool)));
connect(m_useQmlDebugger, SIGNAL(clicked(bool)),
SLOT(useQmlDebuggerClicked(bool)));
connect(m_useCppDebugger, SIGNAL(clicked(bool)),
SLOT(useCppDebuggerClicked(bool)));
connect(m_debugServerPort, SIGNAL(valueChanged(int)),
SLOT(qmlDebugServerPortChanged(int)));
connect(m_useMultiProcess, SIGNAL(toggled(bool)),
SLOT(useMultiProcessToggled(bool)));
QHBoxLayout *qmlLayout = new QHBoxLayout;
connect(m_useQmlDebugger, &QAbstractButton::toggled,
this, &DebuggerRunConfigWidget::useQmlDebuggerToggled);
connect(m_useQmlDebugger, &QAbstractButton::clicked,
this, &DebuggerRunConfigWidget::useQmlDebuggerClicked);
connect(m_useCppDebugger, &QAbstractButton::clicked,
this, &DebuggerRunConfigWidget::useCppDebuggerClicked);
connect(m_debugServerPort, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &DebuggerRunConfigWidget::qmlDebugServerPortChanged);
connect(m_useMultiProcess, &QAbstractButton::toggled,
this, &DebuggerRunConfigWidget::useMultiProcessToggled);
auto qmlLayout = new QHBoxLayout;
qmlLayout->setMargin(0);
qmlLayout->addWidget(m_useQmlDebugger);
qmlLayout->addWidget(m_debugServerPortLabel);
......@@ -141,7 +141,7 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
qmlLayout->addWidget(m_qmlDebuggerInfoLabel);
qmlLayout->addStretch();
QVBoxLayout *layout = new QVBoxLayout;
auto layout = new QVBoxLayout;
layout->setMargin(0);
layout->addWidget(m_useCppDebugger);
layout->addLayout(qmlLayout);
......
......@@ -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);
......
......@@ -231,16 +231,17 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
//ExtensionSystem::PluginManager::addObject(m_debugInfoTaskHandler);
m_commandTimer.setSingleShot(true);
connect(&m_commandTimer, &QTimer::timeout, this, &GdbEngine::commandTimeout);