Debugger: Some code modernization

Qt 5 signal/slot, a few auto.

Change-Id: Ia17f1b3dcd41dfe0a373c14e7c1d34d210d084f1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-02-12 13:50:54 +01:00
parent 0eabe62786
commit f1c5889e77
15 changed files with 175 additions and 156 deletions

View File

@@ -144,7 +144,7 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
{ {
setWindowTitle(tr("Edit Breakpoint Properties")); setWindowTitle(tr("Edit Breakpoint Properties"));
QGroupBox *groupBoxBasic = new QGroupBox(tr("Basic"), this); auto groupBoxBasic = new QGroupBox(tr("Basic"), this);
// Match BreakpointType (omitting unknown type). // Match BreakpointType (omitting unknown type).
QStringList types; QStringList types;
@@ -195,7 +195,7 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
m_labelFunction = new QLabel(tr("Fun&ction:"), groupBoxBasic); m_labelFunction = new QLabel(tr("Fun&ction:"), groupBoxBasic);
m_labelFunction->setBuddy(m_lineEditFunction); 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_checkBoxTracepoint = new QCheckBox(groupBoxAdvanced);
m_labelTracepoint = new QLabel(tr("T&racepoint only:"), 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_labelType, m_comboBoxType);
basicLayout->addRow(m_labelFileName, m_pathChooserFileName); basicLayout->addRow(m_labelFileName, m_pathChooserFileName);
basicLayout->addRow(m_labelLineNumber, m_lineEditLineNumber); 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_labelFunction, m_lineEditFunction);
basicLayout->addRow(m_labelOneShot, m_checkBoxOneShot); basicLayout->addRow(m_labelOneShot, m_checkBoxOneShot);
QFormLayout *advancedLeftLayout = new QFormLayout(); auto advancedLeftLayout = new QFormLayout();
advancedLeftLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); advancedLeftLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
advancedLeftLayout->addRow(m_labelCondition, m_lineEditCondition); advancedLeftLayout->addRow(m_labelCondition, m_lineEditCondition);
advancedLeftLayout->addRow(m_labelIgnoreCount, m_spinBoxIgnoreCount); 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_labelUseFullPath, m_comboBoxPathUsage);
advancedLeftLayout->addRow(m_labelModule, m_lineEditModule); advancedLeftLayout->addRow(m_labelModule, m_lineEditModule);
QFormLayout *advancedRightLayout = new QFormLayout(); auto advancedRightLayout = new QFormLayout();
advancedRightLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); advancedRightLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
advancedRightLayout->addRow(m_labelCommands, m_textEditCommands); advancedRightLayout->addRow(m_labelCommands, m_textEditCommands);
advancedRightLayout->addRow(m_labelTracepoint, m_checkBoxTracepoint); advancedRightLayout->addRow(m_labelTracepoint, m_checkBoxTracepoint);
advancedRightLayout->addRow(m_labelMessage, m_lineEditMessage); advancedRightLayout->addRow(m_labelMessage, m_lineEditMessage);
QHBoxLayout *horizontalLayout = new QHBoxLayout(groupBoxAdvanced); auto horizontalLayout = new QHBoxLayout(groupBoxAdvanced);
horizontalLayout->addLayout(advancedLeftLayout); horizontalLayout->addLayout(advancedLeftLayout);
horizontalLayout->addSpacing(15); horizontalLayout->addSpacing(15);
horizontalLayout->addLayout(advancedRightLayout); horizontalLayout->addLayout(advancedRightLayout);
QVBoxLayout *verticalLayout = new QVBoxLayout(this); auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addWidget(groupBoxBasic); verticalLayout->addWidget(groupBoxBasic);
verticalLayout->addSpacing(10); verticalLayout->addSpacing(10);
verticalLayout->addWidget(groupBoxAdvanced); verticalLayout->addWidget(groupBoxAdvanced);
@@ -316,9 +316,10 @@ BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
verticalLayout->addWidget(m_buttonBox); verticalLayout->addWidget(m_buttonBox);
verticalLayout->setStretchFactor(groupBoxAdvanced, 10); verticalLayout->setStretchFactor(groupBoxAdvanced, 10);
connect(m_comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int))); connect(m_comboBoxType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept())); this, &BreakpointDialog::typeChanged);
connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject())); connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
} }
void BreakpointDialog::setType(BreakpointType type) void BreakpointDialog::setType(BreakpointType type)
@@ -654,18 +655,18 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(QWidget *parent) :
m_buttonBox = new QDialogButtonBox(this); m_buttonBox = new QDialogButtonBox(this);
m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
QFormLayout *formLayout = new QFormLayout; auto formLayout = new QFormLayout;
if (currentEngine()->hasCapability(BreakConditionCapability)) if (currentEngine()->hasCapability(BreakConditionCapability))
formLayout->addRow(tr("&Condition:"), m_lineEditCondition); formLayout->addRow(tr("&Condition:"), m_lineEditCondition);
formLayout->addRow(tr("&Ignore count:"), m_spinBoxIgnoreCount); formLayout->addRow(tr("&Ignore count:"), m_spinBoxIgnoreCount);
formLayout->addRow(tr("&Thread specification:"), m_lineEditThreadSpec); formLayout->addRow(tr("&Thread specification:"), m_lineEditThreadSpec);
QVBoxLayout *verticalLayout = new QVBoxLayout(this); auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout); verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(m_buttonBox); verticalLayout->addWidget(m_buttonBox);
QObject::connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
QObject::connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
} }
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
@@ -678,8 +679,8 @@ BreakTreeView::BreakTreeView()
{ {
setWindowIcon(QIcon(QLatin1String(":/debugger/images/debugger_breakpoints.png"))); setWindowIcon(QIcon(QLatin1String(":/debugger/images/debugger_breakpoints.png")));
setSelectionMode(QAbstractItemView::ExtendedSelection); setSelectionMode(QAbstractItemView::ExtendedSelection);
connect(action(UseAddressInBreakpointsView), connect(action(UseAddressInBreakpointsView), &QAction::toggled,
SIGNAL(toggled(bool)), SLOT(showAddressColumn(bool))); this, &BreakTreeView::showAddressColumn);
} }
void BreakTreeView::showAddressColumn(bool on) void BreakTreeView::showAddressColumn(bool on)

View File

@@ -340,17 +340,22 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp) :
m_watchPointY(0), m_watchPointY(0),
m_ignoreCdbOutput(false) 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")); setObjectName(QLatin1String("CdbEngine"));
connect(&m_process, SIGNAL(finished(int)), this, SLOT(processFinished()));
connect(&m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError())); connect(action(OperateByInstruction), &QAction::triggered,
connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readyReadStandardOut())); this, &CdbEngine::operateByInstructionTriggered);
connect(&m_process, SIGNAL(readyReadStandardError()), this, SLOT(readyReadStandardOut())); 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() void CdbEngine::init()

View File

@@ -230,8 +230,8 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
Utils::SavedAction *registerAction = action(RegisterForPostMortem); Utils::SavedAction *registerAction = action(RegisterForPostMortem);
m_group->insert(registerAction, m_group->insert(registerAction,
checkBoxRegisterForPostMortem); checkBoxRegisterForPostMortem);
connect(registerAction, SIGNAL(toggled(bool)), connect(registerAction, &QAction::toggled,
checkBoxRegisterForPostMortem, SLOT(setChecked(bool))); checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
} else { } else {
checkBoxRegisterForPostMortem->setVisible(false); checkBoxRegisterForPostMortem->setVisible(false);
} }

View File

@@ -282,11 +282,11 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
"If empty, $SYSROOT/usr/lib/debug will be chosen.")); "If empty, $SYSROOT/usr/lib/debug will be chosen."));
d->debuginfoPathChooser->setHistoryCompleter(QLatin1String("Debugger.DebugLocation.History")); d->debuginfoPathChooser->setHistoryCompleter(QLatin1String("Debugger.DebugLocation.History"));
QFrame *line = new QFrame(this); auto line = new QFrame(this);
line->setFrameShape(QFrame::HLine); line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken); line->setFrameShadow(QFrame::Sunken);
QFrame *line2 = new QFrame(this); auto line2 = new QFrame(this);
line2->setFrameShape(QFrame::HLine); line2->setFrameShape(QFrame::HLine);
line2->setFrameShadow(QFrame::Sunken); line2->setFrameShadow(QFrame::Sunken);
@@ -296,7 +296,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
d->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); d->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
QFormLayout *formLayout = new QFormLayout(); auto formLayout = new QFormLayout();
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
formLayout->addRow(tr("&Kit:"), d->kitChooser); formLayout->addRow(tr("&Kit:"), d->kitChooser);
formLayout->addRow(d->serverPortLabel, d->serverPortSpinBox); formLayout->addRow(d->serverPortLabel, d->serverPortSpinBox);
@@ -311,17 +311,18 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
formLayout->addRow(line2); formLayout->addRow(line2);
formLayout->addRow(tr("&Recent:"), d->historyComboBox); formLayout->addRow(tr("&Recent:"), d->historyComboBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this); auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout); verticalLayout->addLayout(formLayout);
verticalLayout->addStretch(); verticalLayout->addStretch();
verticalLayout->addWidget(line); verticalLayout->addWidget(line);
verticalLayout->addWidget(d->buttonBox); verticalLayout->addWidget(d->buttonBox);
connect(d->localExecutablePathChooser, SIGNAL(changed(QString)), SLOT(updateState())); connect(d->localExecutablePathChooser, &PathChooser::changed,
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept())); this, &StartApplicationDialog::updateState);
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject())); connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(d->historyComboBox, SIGNAL(currentIndexChanged(int)), connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
SLOT(historyIndexChanged(int))); connect(d->historyComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &StartApplicationDialog::historyIndexChanged);
updateState(); updateState();
} }
@@ -493,20 +494,20 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
d->portSpinBox->setMaximum(65535); d->portSpinBox->setMaximum(65535);
d->portSpinBox->setValue(3768); d->portSpinBox->setValue(3768);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this); auto buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
QFormLayout *formLayout = new QFormLayout(); auto formLayout = new QFormLayout();
formLayout->addRow(tr("Kit:"), d->kitChooser); formLayout->addRow(tr("Kit:"), d->kitChooser);
formLayout->addRow(tr("&Port:"), d->portSpinBox); formLayout->addRow(tr("&Port:"), d->portSpinBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this); auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout); verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(buttonBox); verticalLayout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, SIGNAL(rejected()), SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
} }
AttachToQmlPortDialog::~AttachToQmlPortDialog() AttachToQmlPortDialog::~AttachToQmlPortDialog()
@@ -567,34 +568,38 @@ StartRemoteCdbDialog::StartRemoteCdbDialog(QWidget *parent) :
setWindowTitle(tr("Start a CDB Remote Session")); setWindowTitle(tr("Start a CDB Remote Session"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); 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->setWordWrap(true);
helpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); helpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
QLabel *label = new QLabel(tr("&Connection:")); auto label = new QLabel(tr("&Connection:"));
label->setBuddy(m_lineEdit); label->setBuddy(m_lineEdit);
m_lineEdit->setMinimumWidth(400); 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(helpLabel);
formLayout->addRow(label, m_lineEdit); formLayout->addRow(label, m_lineEdit);
groupBox->setLayout(formLayout); groupBox->setLayout(formLayout);
QVBoxLayout *vLayout = new QVBoxLayout(this); auto vLayout = new QVBoxLayout(this);
vLayout->addWidget(groupBox); vLayout->addWidget(groupBox);
vLayout->addWidget(box); vLayout->addWidget(box);
m_okButton = box->button(QDialogButtonBox::Ok); m_okButton = box->button(QDialogButtonBox::Ok);
m_okButton->setEnabled(false); m_okButton->setEnabled(false);
connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); connect(m_lineEdit, &QLineEdit::textChanged,
connect(m_lineEdit, SIGNAL(returnPressed()), m_okButton, SLOT(animateClick())); this, &StartRemoteCdbDialog::textChanged);
connect(box, SIGNAL(accepted()), this, SLOT(accept())); connect(m_lineEdit, &QLineEdit::returnPressed,
connect(box, SIGNAL(rejected()), this, SLOT(reject())); [this] { m_okButton->animateClick(); });
connect(box, &QDialogButtonBox::accepted,
this, &StartRemoteCdbDialog::accept);
connect(box, &QDialogButtonBox::rejected,
this, &QDialog::reject);
} }
void StartRemoteCdbDialog::accept() void StartRemoteCdbDialog::accept()
@@ -636,18 +641,20 @@ AddressDialog::AddressDialog(QWidget *parent) :
{ {
setWindowTitle(tr("Select Start Address")); setWindowTitle(tr("Select Start Address"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QHBoxLayout *hLayout = new QHBoxLayout;
auto hLayout = new QHBoxLayout;
hLayout->addWidget(new QLabel(tr("Enter an address:") + QLatin1Char(' '))); hLayout->addWidget(new QLabel(tr("Enter an address:") + QLatin1Char(' ')));
hLayout->addWidget(m_lineEdit); hLayout->addWidget(m_lineEdit);
QVBoxLayout *vLayout = new QVBoxLayout;
auto vLayout = new QVBoxLayout;
vLayout->addLayout(hLayout); vLayout->addLayout(hLayout);
vLayout->addWidget(m_box); vLayout->addWidget(m_box);
setLayout(vLayout); setLayout(vLayout);
connect(m_box, SIGNAL(accepted()), this, SLOT(accept())); connect(m_box, &QDialogButtonBox::accepted, this, &AddressDialog::accept);
connect(m_box, SIGNAL(rejected()), this, SLOT(reject())); connect(m_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_lineEdit, SIGNAL(returnPressed()), this, SLOT(accept())); connect(m_lineEdit, &QLineEdit::returnPressed, this, &AddressDialog::accept);
connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); connect(m_lineEdit, &QLineEdit::textChanged, this, &AddressDialog::textChanged);
setOkButtonEnabled(false); setOkButtonEnabled(false);
} }
@@ -732,20 +739,20 @@ StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent)
d->buttonBox = new QDialogButtonBox(this); d->buttonBox = new QDialogButtonBox(this);
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
QFormLayout *formLayout = new QFormLayout(); auto formLayout = new QFormLayout();
formLayout->addRow(tr("&Host:"), d->host); formLayout->addRow(tr("&Host:"), d->host);
formLayout->addRow(tr("&Username:"), d->username); formLayout->addRow(tr("&Username:"), d->username);
formLayout->addRow(tr("&Password:"), d->password); formLayout->addRow(tr("&Password:"), d->password);
formLayout->addRow(tr("&Engine path:"), d->enginePath); formLayout->addRow(tr("&Engine path:"), d->enginePath);
formLayout->addRow(tr("&Inferior path:"), d->inferiorPath); formLayout->addRow(tr("&Inferior path:"), d->inferiorPath);
QVBoxLayout *verticalLayout = new QVBoxLayout(this); auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout); verticalLayout->addLayout(formLayout);
verticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); verticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
verticalLayout->addWidget(d->buttonBox); verticalLayout->addWidget(d->buttonBox);
connect(d->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(d->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
} }
StartRemoteEngineDialog::~StartRemoteEngineDialog() StartRemoteEngineDialog::~StartRemoteEngineDialog()

View File

@@ -177,10 +177,10 @@ public:
m_memoryAgent(engine), m_memoryAgent(engine),
m_isStateDebugging(false) m_isStateDebugging(false)
{ {
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation())); connect(&m_locationTimer, &QTimer::timeout,
connect(action(IntelFlavor), SIGNAL(valueChanged(QVariant)), this, &DebuggerEnginePrivate::resetLocation);
SLOT(reloadDisassembly())); connect(action(IntelFlavor), &Utils::SavedAction::valueChanged,
this, &DebuggerEnginePrivate::reloadDisassembly);
connect(action(OperateNativeMixed), &QAction::triggered, connect(action(OperateNativeMixed), &QAction::triggered,
engine, &DebuggerEngine::reloadFullStack); engine, &DebuggerEngine::reloadFullStack);
@@ -526,7 +526,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_progress.setProgressRange(0, 1000); d->m_progress.setProgressRange(0, 1000);
FutureProgress *fp = ProgressManager::addTask(d->m_progress.future(), FutureProgress *fp = ProgressManager::addTask(d->m_progress.future(),
tr("Launching Debugger"), "Debugger.Launcher"); tr("Launching Debugger"), "Debugger.Launcher");
connect(fp, SIGNAL(canceled()), this, SLOT(quitDebugger())); connect(fp, &FutureProgress::canceled, this, &DebuggerEngine::quitDebugger);
fp->setKeepOnFinish(FutureProgress::HideOnFinish); fp->setKeepOnFinish(FutureProgress::HideOnFinish);
d->m_progress.reportStarted(); d->m_progress.reportStarted();

View File

@@ -299,8 +299,8 @@ void DebuggerMainWindowPrivate::createViewsMenuItems()
QAction *openMemoryEditorAction = new QAction(this); QAction *openMemoryEditorAction = new QAction(this);
openMemoryEditorAction->setText(tr("Memory...")); openMemoryEditorAction->setText(tr("Memory..."));
connect(openMemoryEditorAction, SIGNAL(triggered()), connect(openMemoryEditorAction, &QAction::triggered,
SLOT(openMemoryEditor())); this, &DebuggerMainWindowPrivate::openMemoryEditor);
// Add menu items // Add menu items
Command *cmd = 0; Command *cmd = 0;
@@ -440,17 +440,17 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
connect(autoHideTitleBarsAction(), SIGNAL(triggered()), connect(autoHideTitleBarsAction(), SIGNAL(triggered()),
d, SLOT(updateDockWidgetSettings())); d, SLOT(updateDockWidgetSettings()));
QBoxLayout *editorHolderLayout = new QVBoxLayout; auto editorHolderLayout = new QVBoxLayout;
editorHolderLayout->setMargin(0); editorHolderLayout->setMargin(0);
editorHolderLayout->setSpacing(0); editorHolderLayout->setSpacing(0);
QWidget *editorAndFindWidget = new QWidget; auto editorAndFindWidget = new QWidget;
editorAndFindWidget->setLayout(editorHolderLayout); editorAndFindWidget->setLayout(editorHolderLayout);
auto editorManagerPlaceHolder = new EditorManagerPlaceHolder(mode); auto editorManagerPlaceHolder = new EditorManagerPlaceHolder(mode);
editorHolderLayout->addWidget(editorManagerPlaceHolder); editorHolderLayout->addWidget(editorManagerPlaceHolder);
editorHolderLayout->addWidget(new FindToolBarPlaceHolder(editorAndFindWidget)); editorHolderLayout->addWidget(new FindToolBarPlaceHolder(editorAndFindWidget));
MiniSplitter *documentAndRightPane = new MiniSplitter; auto documentAndRightPane = new MiniSplitter;
documentAndRightPane->addWidget(editorAndFindWidget); documentAndRightPane->addWidget(editorAndFindWidget);
documentAndRightPane->addWidget(new RightPanePlaceHolder(mode)); documentAndRightPane->addWidget(new RightPanePlaceHolder(mode));
documentAndRightPane->setStretchFactor(0, 1); documentAndRightPane->setStretchFactor(0, 1);
@@ -462,18 +462,18 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
hackyName.replace(QLatin1Char('&'), QString()); hackyName.replace(QLatin1Char('&'), QString());
d->m_viewButton->setText(hackyName); d->m_viewButton->setText(hackyName);
Utils::StyledBar *debugToolBar = new Utils::StyledBar; auto debugToolBar = new Utils::StyledBar;
debugToolBar->setProperty("topBorder", true); debugToolBar->setProperty("topBorder", true);
QHBoxLayout *debugToolBarLayout = new QHBoxLayout(debugToolBar); auto debugToolBarLayout = new QHBoxLayout(debugToolBar);
debugToolBarLayout->setMargin(0); debugToolBarLayout->setMargin(0);
debugToolBarLayout->setSpacing(0); debugToolBarLayout->setSpacing(0);
debugToolBarLayout->addWidget(d->m_debugToolBar); debugToolBarLayout->addWidget(d->m_debugToolBar);
debugToolBarLayout->addWidget(new Utils::StyledSeparator); debugToolBarLayout->addWidget(new Utils::StyledSeparator);
debugToolBarLayout->addWidget(d->m_viewButton); 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->setObjectName(QLatin1String("Debugger Toolbar"));
dock->setWidget(debugToolBar); dock->setWidget(debugToolBar);
dock->setFeatures(QDockWidget::NoDockWidgetFeatures); dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
@@ -483,10 +483,10 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
addDockWidget(Qt::BottomDockWidgetArea, dock); addDockWidget(Qt::BottomDockWidgetArea, dock);
setToolBarDockWidget(dock); setToolBarDockWidget(dock);
QWidget *centralWidget = new QWidget; auto centralWidget = new QWidget;
setCentralWidget(centralWidget); setCentralWidget(centralWidget);
QVBoxLayout *centralLayout = new QVBoxLayout(centralWidget); auto centralLayout = new QVBoxLayout(centralWidget);
centralWidget->setLayout(centralLayout); centralWidget->setLayout(centralLayout);
centralLayout->setMargin(0); centralLayout->setMargin(0);
centralLayout->setSpacing(0); centralLayout->setSpacing(0);
@@ -495,9 +495,9 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
centralLayout->setStretch(1, 0); centralLayout->setStretch(1, 0);
// Right-side window with editor, output etc. // Right-side window with editor, output etc.
MiniSplitter *mainWindowSplitter = new MiniSplitter; auto mainWindowSplitter = new MiniSplitter;
mainWindowSplitter->addWidget(this); mainWindowSplitter->addWidget(this);
QWidget *outputPane = new OutputPanePlaceHolder(mode, mainWindowSplitter); auto outputPane = new OutputPanePlaceHolder(mode, mainWindowSplitter);
outputPane->setObjectName(QLatin1String("DebuggerOutputPanePlaceHolder")); outputPane->setObjectName(QLatin1String("DebuggerOutputPanePlaceHolder"));
mainWindowSplitter->addWidget(outputPane); mainWindowSplitter->addWidget(outputPane);
mainWindowSplitter->setStretchFactor(0, 10); mainWindowSplitter->setStretchFactor(0, 10);
@@ -505,7 +505,7 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
mainWindowSplitter->setOrientation(Qt::Vertical); mainWindowSplitter->setOrientation(Qt::Vertical);
// Navigation and right-side window. // Navigation and right-side window.
MiniSplitter *splitter = new MiniSplitter; auto splitter = new MiniSplitter;
splitter->setFocusProxy(editorManagerPlaceHolder); splitter->setFocusProxy(editorManagerPlaceHolder);
splitter->addWidget(new NavigationWidgetPlaceHolder(mode)); splitter->addWidget(new NavigationWidgetPlaceHolder(mode));
splitter->addWidget(mainWindowSplitter); splitter->addWidget(mainWindowSplitter);

View File

@@ -3398,7 +3398,7 @@ void DebuggerPluginPrivate::testProjectEvaluated()
QVERIFY(!fileName.isEmpty()); QVERIFY(!fileName.isEmpty());
qWarning("Project %s loaded", qPrintable(fileName)); qWarning("Project %s loaded", qPrintable(fileName));
connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)), connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)),
SLOT(testProjectBuilt(bool))); this, SLOT(testProjectBuilt(bool)));
ProjectExplorerPlugin::buildProject(m_testProject); ProjectExplorerPlugin::buildProject(m_testProject);
} }

View File

@@ -122,18 +122,18 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)), connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString))); Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
connect(m_useQmlDebugger, SIGNAL(toggled(bool)), connect(m_useQmlDebugger, &QAbstractButton::toggled,
SLOT(useQmlDebuggerToggled(bool))); this, &DebuggerRunConfigWidget::useQmlDebuggerToggled);
connect(m_useQmlDebugger, SIGNAL(clicked(bool)), connect(m_useQmlDebugger, &QAbstractButton::clicked,
SLOT(useQmlDebuggerClicked(bool))); this, &DebuggerRunConfigWidget::useQmlDebuggerClicked);
connect(m_useCppDebugger, SIGNAL(clicked(bool)), connect(m_useCppDebugger, &QAbstractButton::clicked,
SLOT(useCppDebuggerClicked(bool))); this, &DebuggerRunConfigWidget::useCppDebuggerClicked);
connect(m_debugServerPort, SIGNAL(valueChanged(int)), connect(m_debugServerPort, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
SLOT(qmlDebugServerPortChanged(int))); this, &DebuggerRunConfigWidget::qmlDebugServerPortChanged);
connect(m_useMultiProcess, SIGNAL(toggled(bool)), connect(m_useMultiProcess, &QAbstractButton::toggled,
SLOT(useMultiProcessToggled(bool))); this, &DebuggerRunConfigWidget::useMultiProcessToggled);
QHBoxLayout *qmlLayout = new QHBoxLayout; auto qmlLayout = new QHBoxLayout;
qmlLayout->setMargin(0); qmlLayout->setMargin(0);
qmlLayout->addWidget(m_useQmlDebugger); qmlLayout->addWidget(m_useQmlDebugger);
qmlLayout->addWidget(m_debugServerPortLabel); qmlLayout->addWidget(m_debugServerPortLabel);
@@ -141,7 +141,7 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
qmlLayout->addWidget(m_qmlDebuggerInfoLabel); qmlLayout->addWidget(m_qmlDebuggerInfoLabel);
qmlLayout->addStretch(); qmlLayout->addStretch();
QVBoxLayout *layout = new QVBoxLayout; auto layout = new QVBoxLayout;
layout->setMargin(0); layout->setMargin(0);
layout->addWidget(m_useCppDebugger); layout->addWidget(m_useCppDebugger);
layout->addLayout(qmlLayout); layout->addLayout(qmlLayout);

View File

@@ -228,40 +228,41 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent
m_treeView->setSelectionMode(QAbstractItemView::SingleSelection); m_treeView->setSelectionMode(QAbstractItemView::SingleSelection);
m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows); m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows);
m_treeView->setModel(m_model); m_treeView->setModel(m_model);
connect(m_treeView->selectionModel(), connect(m_treeView->selectionModel(), &QItemSelectionModel::currentRowChanged,
SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, &DebuggerSourcePathMappingWidget::slotCurrentRowChanged);
SLOT(slotCurrentRowChanged(QModelIndex,QModelIndex)));
// Top list/Right part: Buttons. // Top list/Right part: Buttons.
QVBoxLayout *buttonLayout = new QVBoxLayout; auto buttonLayout = new QVBoxLayout;
buttonLayout->addWidget(m_addButton); buttonLayout->addWidget(m_addButton);
buttonLayout->addWidget(m_addQtButton); buttonLayout->addWidget(m_addQtButton);
m_addQtButton->setVisible(sizeof(qtBuildPaths) > 0); m_addQtButton->setVisible(sizeof(qtBuildPaths) > 0);
m_addQtButton->setToolTip(tr("Add a mapping for Qt's source folders " m_addQtButton->setToolTip(tr("Add a mapping for Qt's source folders "
"when using an unpatched version of Qt.")); "when using an unpatched version of Qt."));
buttonLayout->addWidget(m_removeButton); buttonLayout->addWidget(m_removeButton);
connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAdd())); connect(m_addButton, &QAbstractButton::clicked,
connect(m_addQtButton, SIGNAL(clicked()), this, SLOT(slotAddQt())); this, &DebuggerSourcePathMappingWidget::slotAdd);
connect(m_addQtButton, &QAbstractButton::clicked,
connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemove())); this, &DebuggerSourcePathMappingWidget::slotAddQt);
connect(m_removeButton, &QAbstractButton::clicked,
this, &DebuggerSourcePathMappingWidget::slotRemove);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding)); buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
// Assemble top // Assemble top
QHBoxLayout *treeHLayout = new QHBoxLayout; auto treeHLayout = new QHBoxLayout;
treeHLayout->addWidget(m_treeView); treeHLayout->addWidget(m_treeView);
treeHLayout->addLayout(buttonLayout); treeHLayout->addLayout(buttonLayout);
// Edit part // Edit part
m_targetChooser->setExpectedKind(PathChooser::ExistingDirectory); m_targetChooser->setExpectedKind(PathChooser::ExistingDirectory);
m_targetChooser->setHistoryCompleter(QLatin1String("Debugger.MappingTarget.History")); m_targetChooser->setHistoryCompleter(QLatin1String("Debugger.MappingTarget.History"));
connect(m_sourceLineEdit, SIGNAL(textChanged(QString)), connect(m_sourceLineEdit, &QLineEdit::textChanged,
this, SLOT(slotEditSourceFieldChanged())); this, &DebuggerSourcePathMappingWidget::slotEditSourceFieldChanged);
connect(m_targetChooser, SIGNAL(changed(QString)), connect(m_targetChooser, &PathChooser::changed,
this, SLOT(slotEditTargetFieldChanged())); this, &DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged);
QFormLayout *editLayout = new QFormLayout; auto editLayout = new QFormLayout;
const QString sourceToolTip = tr("The source path contained in the " const QString sourceToolTip = tr("The source path contained in the "
"debug information of the executable as reported by the debugger"); "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); editSourceLabel->setToolTip(sourceToolTip);
m_sourceLineEdit->setToolTip(sourceToolTip); m_sourceLineEdit->setToolTip(sourceToolTip);
editSourceLabel->setBuddy(m_sourceLineEdit); editSourceLabel->setBuddy(m_sourceLineEdit);
@@ -269,7 +270,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent
const QString targetToolTip = tr("The actual location of the source " const QString targetToolTip = tr("The actual location of the source "
"tree on the local machine"); "tree on the local machine");
QLabel *editTargetLabel = new QLabel(tr("&Target path:")); auto editTargetLabel = new QLabel(tr("&Target path:"));
editTargetLabel->setToolTip(targetToolTip); editTargetLabel->setToolTip(targetToolTip);
editTargetLabel->setBuddy(m_targetChooser); editTargetLabel->setBuddy(m_targetChooser);
m_targetChooser->setToolTip(targetToolTip); m_targetChooser->setToolTip(targetToolTip);
@@ -279,7 +280,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent
chooser->addSupportedWidget(m_targetChooser->lineEdit()); chooser->addSupportedWidget(m_targetChooser->lineEdit());
// Main layout // Main layout
QVBoxLayout *mainLayout = new QVBoxLayout; auto mainLayout = new QVBoxLayout;
mainLayout->addLayout(treeHLayout); mainLayout->addLayout(treeHLayout);
mainLayout->addLayout(editLayout); mainLayout->addLayout(editLayout);
setLayout(mainLayout); setLayout(mainLayout);

View File

@@ -231,16 +231,17 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
//ExtensionSystem::PluginManager::addObject(m_debugInfoTaskHandler); //ExtensionSystem::PluginManager::addObject(m_debugInfoTaskHandler);
m_commandTimer.setSingleShot(true); m_commandTimer.setSingleShot(true);
connect(&m_commandTimer, &QTimer::timeout, this, &GdbEngine::commandTimeout); connect(&m_commandTimer, &QTimer::timeout,
this, &GdbEngine::commandTimeout);
connect(action(AutoDerefPointers), SIGNAL(valueChanged(QVariant)), connect(action(AutoDerefPointers), &SavedAction::valueChanged,
SLOT(reloadLocals())); this, &GdbEngine::reloadLocals);
connect(action(CreateFullBacktrace), SIGNAL(triggered()), connect(action(CreateFullBacktrace), &QAction::triggered,
SLOT(createFullBacktrace())); this, &GdbEngine::createFullBacktrace);
connect(action(UseDebuggingHelpers), SIGNAL(valueChanged(QVariant)), connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
SLOT(reloadLocals())); this, &GdbEngine::reloadLocals);
connect(action(UseDynamicType), SIGNAL(valueChanged(QVariant)), connect(action(UseDynamicType), &SavedAction::valueChanged,
SLOT(reloadLocals())); this, &GdbEngine::reloadLocals);
} }
GdbEngine::~GdbEngine() GdbEngine::~GdbEngine()

View File

@@ -129,12 +129,13 @@ protected: ////////// Gdb Process Management //////////
void handleAdapterCrashed(const QString &msg); void handleAdapterCrashed(const QString &msg);
private slots: private slots:
friend class GdbPlainEngine;
void handleInterruptDeviceInferior(const QString &error); void handleInterruptDeviceInferior(const QString &error);
void handleGdbFinished(int, QProcess::ExitStatus status); void handleGdbFinished(int, QProcess::ExitStatus status);
void handleGdbError(QProcess::ProcessError error); void handleGdbError(QProcess::ProcessError error);
void readDebugeeOutput(const QByteArray &data);
void readGdbStandardOutput(); void readGdbStandardOutput();
void readGdbStandardError(); void readGdbStandardError();
void readDebugeeOutput(const QByteArray &data);
private: private:
QTextCodec *m_outputCodec; QTextCodec *m_outputCodec;

View File

@@ -51,8 +51,8 @@ GdbPlainEngine::GdbPlainEngine(const DebuggerStartParameters &startParameters)
: GdbEngine(startParameters) : GdbEngine(startParameters)
{ {
// Output // Output
connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)), connect(&m_outputCollector, &OutputCollector::byteDelivery,
this, SLOT(readDebugeeOutput(QByteArray))); this, &GdbEngine::readDebugeeOutput);
} }
void GdbPlainEngine::setupInferior() void GdbPlainEngine::setupInferior()

View File

@@ -46,6 +46,8 @@
#include <QFileInfo> #include <QFileInfo>
using namespace Utils;
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -60,8 +62,9 @@ namespace Internal {
GdbRemoteServerEngine::GdbRemoteServerEngine(const DebuggerStartParameters &startParameters) GdbRemoteServerEngine::GdbRemoteServerEngine(const DebuggerStartParameters &startParameters)
: GdbEngine(startParameters), m_startAttempted(false) : GdbEngine(startParameters), m_startAttempted(false)
{ {
if (Utils::HostOsInfo::isWindowsHost()) if (HostOsInfo::isWindowsHost())
m_gdbProc->setUseCtrlCStub(startParameters.useCtrlCStub); // This is only set for QNX/BlackBerry m_gdbProc->setUseCtrlCStub(startParameters.useCtrlCStub); // This is only set for QNX/BlackBerry
connect(&m_uploadProc, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error), connect(&m_uploadProc, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, &GdbRemoteServerEngine::uploadProcError); this, &GdbRemoteServerEngine::uploadProcError);
connect(&m_uploadProc, &QProcess::readyReadStandardOutput, connect(&m_uploadProc, &QProcess::readyReadStandardOutput,
@@ -80,9 +83,9 @@ void GdbRemoteServerEngine::setupEngine()
// Provide script information about the environment // Provide script information about the environment
QString arglist; QString arglist;
Utils::QtcProcess::addArg(&arglist, startParameters().serverStartScript); QtcProcess::addArg(&arglist, startParameters().serverStartScript);
Utils::QtcProcess::addArg(&arglist, startParameters().executable); QtcProcess::addArg(&arglist, startParameters().executable);
Utils::QtcProcess::addArg(&arglist, startParameters().remoteChannel); QtcProcess::addArg(&arglist, startParameters().remoteChannel);
m_uploadProc.start(_("/bin/sh ") + arglist); m_uploadProc.start(_("/bin/sh ") + arglist);
m_uploadProc.waitForStarted(); m_uploadProc.waitForStarted();
@@ -172,12 +175,12 @@ void GdbRemoteServerEngine::setupInferior()
//const QByteArray sysroot = sp.sysroot.toLocal8Bit(); //const QByteArray sysroot = sp.sysroot.toLocal8Bit();
//const QByteArray remoteArch = sp.remoteArchitecture.toLatin1(); //const QByteArray remoteArch = sp.remoteArchitecture.toLatin1();
const QString args = isMasterEngine() ? startParameters().processArgs : masterEngine()->startParameters().processArgs; const QString args = isMasterEngine() ? startParameters().processArgs
: masterEngine()->startParameters().processArgs;
// if (!remoteArch.isEmpty()) // if (!remoteArch.isEmpty())
// postCommand("set architecture " + remoteArch); // postCommand("set architecture " + remoteArch);
const QString solibSearchPath const QString solibSearchPath = sp.solibSearchPath.join(HostOsInfo::pathListSeparator());
= sp.solibSearchPath.join(Utils::HostOsInfo::pathListSeparator());
if (!solibSearchPath.isEmpty()) if (!solibSearchPath.isEmpty())
postCommand("set solib-search-path " + solibSearchPath.toLocal8Bit()); postCommand("set solib-search-path " + solibSearchPath.toLocal8Bit());
@@ -431,7 +434,7 @@ void GdbRemoteServerEngine::interruptInferior2()
if (boolSetting(TargetAsync)) { if (boolSetting(TargetAsync)) {
postCommand("-exec-interrupt", GdbEngine::Immediate, postCommand("-exec-interrupt", GdbEngine::Immediate,
CB(handleInterruptInferior)); CB(handleInterruptInferior));
} else if (m_isQnxGdb && Utils::HostOsInfo::isWindowsHost()) { } else if (m_isQnxGdb && HostOsInfo::isWindowsHost()) {
m_gdbProc->winInterruptByCtrlC(); m_gdbProc->winInterruptByCtrlC();
} else { } else {
bool ok = m_gdbProc->interrupt(); bool ok = m_gdbProc->interrupt();

View File

@@ -104,11 +104,11 @@ ImageViewer::ImageViewer(QWidget *parent)
, m_imageWidget(new ImageWidget) , m_imageWidget(new ImageWidget)
, m_infoLabel(new QLabel) , m_infoLabel(new QLabel)
{ {
QVBoxLayout *mainLayout = new QVBoxLayout(this); auto mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(m_infoLabel); mainLayout->addWidget(m_infoLabel);
mainLayout->addWidget(m_scrollArea); mainLayout->addWidget(m_scrollArea);
m_scrollArea->setWidget(m_imageWidget); m_scrollArea->setWidget(m_imageWidget);
connect(m_imageWidget, SIGNAL(clicked(QString)), this, SLOT(clicked(QString))); connect(m_imageWidget, &ImageWidget::clicked, this, &ImageViewer::clicked);
} }
void ImageViewer::setImage(const QImage &i) void ImageViewer::setImage(const QImage &i)

View File

@@ -145,27 +145,27 @@ class DebuggerPane : public QPlainTextEdit
Q_OBJECT Q_OBJECT
public: public:
DebuggerPane(QWidget *parent) DebuggerPane(LogWindow *parent)
: QPlainTextEdit(parent) : QPlainTextEdit(parent)
{ {
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
m_clearContentsAction = new QAction(this); m_clearContentsAction = new QAction(this);
m_clearContentsAction->setText(tr("Clear Contents")); m_clearContentsAction->setText(tr("Clear Contents"));
m_clearContentsAction->setEnabled(true); m_clearContentsAction->setEnabled(true);
connect(m_clearContentsAction, SIGNAL(triggered(bool)), connect(m_clearContentsAction, &QAction::triggered,
parent, SLOT(clearContents())); parent, &LogWindow::clearContents);
m_saveContentsAction = new QAction(this); m_saveContentsAction = new QAction(this);
m_saveContentsAction->setText(tr("Save Contents")); m_saveContentsAction->setText(tr("Save Contents"));
m_saveContentsAction->setEnabled(true); m_saveContentsAction->setEnabled(true);
connect(m_saveContentsAction, SIGNAL(triggered()), connect(m_saveContentsAction, &QAction::triggered,
this, SLOT(saveContents())); this, &DebuggerPane::saveContents);
m_reloadDebuggingHelpersAction = new QAction(this); m_reloadDebuggingHelpersAction = new QAction(this);
m_reloadDebuggingHelpersAction->setText(tr("Reload Debugging Helpers")); m_reloadDebuggingHelpersAction->setText(tr("Reload Debugging Helpers"));
m_reloadDebuggingHelpersAction->setEnabled(true); m_reloadDebuggingHelpersAction->setEnabled(true);
connect(m_reloadDebuggingHelpersAction, SIGNAL(triggered()), connect(m_reloadDebuggingHelpersAction, &QAction::triggered,
this, SLOT(reloadDebuggingHelpers())); this, &DebuggerPane::reloadDebuggingHelpers);
} }
void contextMenuEvent(QContextMenuEvent *ev) void contextMenuEvent(QContextMenuEvent *ev)
@@ -209,11 +209,10 @@ public:
setUndoRedoEnabled(true); setUndoRedoEnabled(true);
} }
private slots: private:
void saveContents(); void saveContents();
void reloadDebuggingHelpers(); void reloadDebuggingHelpers();
private:
QAction *m_clearContentsAction; QAction *m_clearContentsAction;
QAction *m_saveContentsAction; QAction *m_saveContentsAction;
QAction *m_reloadDebuggingHelpersAction; QAction *m_reloadDebuggingHelpersAction;
@@ -239,7 +238,7 @@ class InputPane : public DebuggerPane
{ {
Q_OBJECT Q_OBJECT
public: public:
InputPane(QWidget *parent) InputPane(LogWindow *parent)
: DebuggerPane(parent) : DebuggerPane(parent)
{ {
(void) new InputHighlighter(this); (void) new InputHighlighter(this);
@@ -305,7 +304,7 @@ class CombinedPane : public DebuggerPane
{ {
Q_OBJECT Q_OBJECT
public: public:
CombinedPane(QWidget *parent) CombinedPane(LogWindow *parent)
: DebuggerPane(parent) : DebuggerPane(parent)
{ {
(void) new OutputHighlighter(this); (void) new OutputHighlighter(this);
@@ -354,7 +353,7 @@ LogWindow::LogWindow(QWidget *parent)
m_ignoreNextInputEcho = false; m_ignoreNextInputEcho = false;
QSplitter *m_splitter = new Core::MiniSplitter(Qt::Horizontal); auto m_splitter = new Core::MiniSplitter(Qt::Horizontal);
m_splitter->setParent(this); m_splitter->setParent(this);
// Mixed input/output. // Mixed input/output.
@@ -374,25 +373,25 @@ LogWindow::LogWindow(QWidget *parent)
m_commandEdit->setFrame(false); m_commandEdit->setFrame(false);
m_commandEdit->setHistoryCompleter(QLatin1String("DebuggerInput")); m_commandEdit->setHistoryCompleter(QLatin1String("DebuggerInput"));
QToolButton *repeatButton = new QToolButton(this); auto repeatButton = new QToolButton(this);
repeatButton->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepover_small.png"))); repeatButton->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepover_small.png")));
repeatButton->setIconSize(QSize(12, 12)); repeatButton->setIconSize(QSize(12, 12));
repeatButton->setToolTip(tr("Repeat last command for debug reasons.")); repeatButton->setToolTip(tr("Repeat last command for debug reasons."));
QHBoxLayout *commandBox = new QHBoxLayout; auto commandBox = new QHBoxLayout;
commandBox->addWidget(repeatButton); commandBox->addWidget(repeatButton);
commandBox->addWidget(new QLabel(tr("Command:"), this)); commandBox->addWidget(new QLabel(tr("Command:"), this));
commandBox->addWidget(m_commandEdit); commandBox->addWidget(m_commandEdit);
commandBox->setMargin(2); commandBox->setMargin(2);
commandBox->setSpacing(6); commandBox->setSpacing(6);
QVBoxLayout *leftBox = new QVBoxLayout; auto leftBox = new QVBoxLayout;
leftBox->addWidget(m_inputText); leftBox->addWidget(m_inputText);
leftBox->addItem(commandBox); leftBox->addItem(commandBox);
leftBox->setMargin(0); leftBox->setMargin(0);
leftBox->setSpacing(0); leftBox->setSpacing(0);
QWidget *leftDummy = new QWidget; auto leftDummy = new QWidget;
leftDummy->setLayout(leftBox); leftDummy->setLayout(leftBox);
m_splitter->addWidget(leftDummy); m_splitter->addWidget(leftDummy);
@@ -400,14 +399,14 @@ LogWindow::LogWindow(QWidget *parent)
m_splitter->setStretchFactor(0, 1); m_splitter->setStretchFactor(0, 1);
m_splitter->setStretchFactor(1, 3); m_splitter->setStretchFactor(1, 3);
QVBoxLayout *layout = new QVBoxLayout(this); auto layout = new QVBoxLayout(this);
layout->setMargin(0); layout->setMargin(0);
layout->setSpacing(0); layout->setSpacing(0);
layout->addWidget(m_splitter); layout->addWidget(m_splitter);
layout->addWidget(new Core::FindToolBarPlaceHolder(this)); layout->addWidget(new Core::FindToolBarPlaceHolder(this));
setLayout(layout); setLayout(layout);
Aggregation::Aggregate *aggregate = new Aggregation::Aggregate; auto aggregate = new Aggregation::Aggregate;
aggregate->add(m_combinedText); aggregate->add(m_combinedText);
aggregate->add(new Core::BaseTextFind(m_combinedText)); aggregate->add(new Core::BaseTextFind(m_combinedText));
@@ -419,14 +418,15 @@ LogWindow::LogWindow(QWidget *parent)
SIGNAL(statusMessageRequested(QString,int))); SIGNAL(statusMessageRequested(QString,int)));
connect(m_inputText, SIGNAL(commandSelected(int)), connect(m_inputText, SIGNAL(commandSelected(int)),
m_combinedText, SLOT(gotoResult(int))); m_combinedText, SLOT(gotoResult(int)));
connect(m_commandEdit, SIGNAL(returnPressed()), connect(m_commandEdit, &QLineEdit::returnPressed,
SLOT(sendCommand())); this, &LogWindow::sendCommand);
connect(m_inputText, SIGNAL(executeLineRequested()), connect(m_inputText, SIGNAL(executeLineRequested()),
SLOT(executeLine())); SLOT(executeLine()));
connect(repeatButton, SIGNAL(clicked()), connect(repeatButton, &QAbstractButton::clicked,
SLOT(repeatLastCommand())); this, &LogWindow::repeatLastCommand);
connect(&m_outputTimer, SIGNAL(timeout()), SLOT(doOutput())); connect(&m_outputTimer, &QTimer::timeout,
this, &LogWindow::doOutput);
setMinimumHeight(60); setMinimumHeight(60);
} }