forked from qt-creator/qt-creator
Debugger: More modernization
New connects, some auto. Change-Id: I768637aae9cbb0a62e9082e56141f212022d8220 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -46,15 +46,13 @@ public:
|
||||
|
||||
static void editBreakpoint(Breakpoint bp, QWidget *parent);
|
||||
|
||||
private slots:
|
||||
void showAddressColumn(bool on);
|
||||
|
||||
private:
|
||||
void rowActivated(const QModelIndex &index);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
void keyPressEvent(QKeyEvent *ev);
|
||||
void mouseDoubleClickEvent(QMouseEvent *ev);
|
||||
|
||||
void showAddressColumn(bool on);
|
||||
void deleteBreakpoints(const Breakpoints &bps);
|
||||
void deleteAllBreakpoints();
|
||||
void addBreakpoint();
|
||||
|
@@ -469,7 +469,11 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
|
||||
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||
debugToolBarLayout->addWidget(d->m_viewButton);
|
||||
|
||||
connect(d->m_viewButton, &QAbstractButton::clicked, this, &DebuggerMainWindow::showViewsMenu);
|
||||
connect(d->m_viewButton, &QAbstractButton::clicked, [this] {
|
||||
QMenu menu;
|
||||
addDockActionsToMenu(&menu);
|
||||
menu.exec(d->m_viewButton->mapToGlobal(QPoint()));
|
||||
});
|
||||
|
||||
auto dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
|
||||
dock->setObjectName(QLatin1String("Debugger Toolbar"));
|
||||
@@ -533,13 +537,6 @@ void DebuggerMainWindow::writeSettings() const
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
void DebuggerMainWindow::showViewsMenu()
|
||||
{
|
||||
QMenu menu;
|
||||
addDockActionsToMenu(&menu);
|
||||
menu.exec(d->m_viewButton->mapToGlobal(QPoint()));
|
||||
}
|
||||
|
||||
void DebuggerMainWindow::readSettings()
|
||||
{
|
||||
QSettings *settings = ICore::settings();
|
||||
|
@@ -86,9 +86,6 @@ public:
|
||||
void readSettings();
|
||||
void writeSettings() const;
|
||||
|
||||
private slots:
|
||||
void showViewsMenu();
|
||||
|
||||
private:
|
||||
friend class Internal::DebuggerMainWindowPrivate;
|
||||
Internal::DebuggerMainWindowPrivate *d;
|
||||
|
@@ -50,12 +50,12 @@
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
|
||||
static const char USE_CPP_DEBUGGER_KEY[] = "RunConfiguration.UseCppDebugger";
|
||||
static const char USE_CPP_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseCppDebuggerAuto";
|
||||
static const char USE_QML_DEBUGGER_KEY[] = "RunConfiguration.UseQmlDebugger";
|
||||
static const char USE_QML_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseQmlDebuggerAuto";
|
||||
static const char QML_DEBUG_SERVER_PORT_KEY[] = "RunConfiguration.QmlDebugServerPort";
|
||||
static const char USE_MULTIPROCESS_KEY[] = "RunConfiguration.UseMultiProcess";
|
||||
const char USE_CPP_DEBUGGER_KEY[] = "RunConfiguration.UseCppDebugger";
|
||||
const char USE_CPP_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseCppDebuggerAuto";
|
||||
const char USE_QML_DEBUGGER_KEY[] = "RunConfiguration.UseQmlDebugger";
|
||||
const char USE_QML_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseQmlDebuggerAuto";
|
||||
const char QML_DEBUG_SERVER_PORT_KEY[] = "RunConfiguration.QmlDebugServerPort";
|
||||
const char USE_MULTIPROCESS_KEY[] = "RunConfiguration.UseMultiProcess";
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Internal {
|
||||
|
||||
class DebuggerRunConfigWidget : public RunConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::RunConfigWidget)
|
||||
|
||||
public:
|
||||
explicit DebuggerRunConfigWidget(DebuggerRunConfigurationAspect *aspect);
|
||||
@@ -79,7 +79,6 @@ public:
|
||||
void showEvent(QShowEvent *event);
|
||||
void update();
|
||||
|
||||
private slots:
|
||||
void useCppDebuggerClicked(bool on);
|
||||
void useQmlDebuggerToggled(bool on);
|
||||
void useQmlDebuggerClicked(bool on);
|
||||
@@ -120,8 +119,8 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
|
||||
new QCheckBox(tr("Enable Debugging of Subprocesses"), this);
|
||||
m_useMultiProcess->setVisible(env.toInt());
|
||||
|
||||
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
|
||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||
connect(m_qmlDebuggerInfoLabel, &QLabel::linkActivated,
|
||||
[](const QString &link) { Core::HelpManager::handleHelpRequest(link); });
|
||||
connect(m_useQmlDebugger, &QAbstractButton::toggled,
|
||||
this, &DebuggerRunConfigWidget::useQmlDebuggerToggled);
|
||||
connect(m_useQmlDebugger, &QAbstractButton::clicked,
|
||||
@@ -343,6 +342,3 @@ RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget()
|
||||
}
|
||||
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
#include "debuggerrunconfigurationaspect.moc"
|
||||
|
@@ -79,10 +79,8 @@ signals:
|
||||
void aboutToNotifyInferiorSetupOk();
|
||||
void stateChanged(Debugger::DebuggerState state);
|
||||
|
||||
private slots:
|
||||
void handleFinished();
|
||||
|
||||
private:
|
||||
void handleFinished();
|
||||
friend class DebuggerRunControlFactory;
|
||||
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
Internal::DebuggerEngine *engine);
|
||||
|
@@ -38,12 +38,6 @@
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CoreGdbAdapter
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
class GdbCoreEngine : public GdbEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -74,7 +68,6 @@ private:
|
||||
QString coreFileName() const;
|
||||
QString coreName() const;
|
||||
|
||||
private slots:
|
||||
void continueSetupEngine();
|
||||
void writeCoreChunk();
|
||||
|
||||
|
@@ -73,7 +73,7 @@ namespace Internal {
|
||||
|
||||
class SelectRemoteFileDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::SelectRemoteFileDialog)
|
||||
|
||||
public:
|
||||
explicit SelectRemoteFileDialog(QWidget *parent);
|
||||
@@ -289,12 +289,12 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
||||
d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
|
||||
d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));
|
||||
|
||||
QHBoxLayout *coreLayout = new QHBoxLayout;
|
||||
auto coreLayout = new QHBoxLayout;
|
||||
coreLayout->addWidget(d->localCoreFileName);
|
||||
coreLayout->addWidget(d->remoteCoreFileName);
|
||||
coreLayout->addWidget(d->selectRemoteCoreButton);
|
||||
|
||||
QFormLayout *formLayout = new QFormLayout;
|
||||
auto formLayout = new QFormLayout;
|
||||
formLayout->setContentsMargins(0, 0, 0, 0);
|
||||
formLayout->setHorizontalSpacing(6);
|
||||
formLayout->setVerticalSpacing(6);
|
||||
@@ -304,13 +304,13 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
||||
formLayout->addRow(tr("&Executable:"), d->localExecFileName);
|
||||
formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);
|
||||
|
||||
QFrame *line = new QFrame(this);
|
||||
auto line = new QFrame(this);
|
||||
line->setFrameShape(QFrame::HLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
formLayout->addRow(d->buttonBox);
|
||||
|
||||
QVBoxLayout *vboxLayout = new QVBoxLayout(this);
|
||||
auto vboxLayout = new QVBoxLayout(this);
|
||||
vboxLayout->addLayout(formLayout);
|
||||
vboxLayout->addStretch();
|
||||
vboxLayout->addWidget(line);
|
||||
@@ -474,5 +474,3 @@ void AttachCoreDialog::setOverrideStartScript(const QString &scriptName)
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
#include "loadcoredialog.moc"
|
||||
|
@@ -68,12 +68,11 @@ public:
|
||||
void setKitId(Core::Id id);
|
||||
void setForceLocalCoreFile(bool on);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void changed();
|
||||
void coreFileChanged(const QString &core);
|
||||
void selectRemoteCoreFile();
|
||||
|
||||
private:
|
||||
AttachCoreDialogPrivate *d;
|
||||
};
|
||||
|
||||
|
@@ -35,19 +35,16 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QStackedWidget>
|
||||
|
||||
const int LOCAL_WIDGET_INDEX = 0;
|
||||
const int INSPECTOR_WIDGET_INDEX = 1;
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(
|
||||
QWidget *locals, QWidget *inspector, QWidget *returnWidget,
|
||||
QWidget *watchers, QWidget *parent)
|
||||
: QWidget(parent),
|
||||
m_showLocals(false)
|
||||
enum { LocalsIndex = 0, InspectorIndex = 1 };
|
||||
|
||||
LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(QWidget *locals,
|
||||
QWidget *inspector, QWidget *returnWidget, QWidget *watchers)
|
||||
: m_showLocals(false)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
|
||||
@@ -71,7 +68,9 @@ LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(
|
||||
// when debugger engine changes states.
|
||||
m_timer.setSingleShot(true);
|
||||
m_timer.setInterval(500); // TODO: remove the magic number!
|
||||
connect(&m_timer, SIGNAL(timeout()), SLOT(showLocals()));
|
||||
connect(&m_timer, &QTimer::timeout, [this] {
|
||||
m_localsAndInspector->setCurrentIndex(m_showLocals ? LocalsIndex : InspectorIndex);
|
||||
});
|
||||
}
|
||||
|
||||
void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
|
||||
@@ -80,16 +79,5 @@ void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
void LocalsAndExpressionsWindow::showLocals()
|
||||
{
|
||||
m_localsAndInspector->setCurrentIndex(m_showLocals ? LOCAL_WIDGET_INDEX
|
||||
: INSPECTOR_WIDGET_INDEX);
|
||||
}
|
||||
|
||||
QWidget *LocalsAndExpressionsWindow::inspectorWidget() const
|
||||
{
|
||||
return m_localsAndInspector->widget(INSPECTOR_WIDGET_INDEX);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
@@ -45,16 +45,12 @@ namespace Internal {
|
||||
class LocalsAndExpressionsWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LocalsAndExpressionsWindow(
|
||||
QWidget *locals, QWidget *inspector,
|
||||
QWidget *returnWidget, QWidget *watchers, QWidget *parent = 0);
|
||||
LocalsAndExpressionsWindow(QWidget *locals, QWidget *inspector,
|
||||
QWidget *returnWidget, QWidget *watchers);
|
||||
|
||||
void setShowLocals(bool showLocals);
|
||||
QWidget *inspectorWidget() const;
|
||||
|
||||
private slots:
|
||||
void showLocals();
|
||||
|
||||
private:
|
||||
QSplitter *m_splitter;
|
||||
|
@@ -43,10 +43,8 @@ class ModulesTreeView : public Utils::BaseTreeView
|
||||
public:
|
||||
ModulesTreeView();
|
||||
|
||||
private slots:
|
||||
void moduleActivated(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
void moduleActivated(const QModelIndex &index);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user