forked from qt-creator/qt-creator
Debugger: Streamline option page code
Change-Id: I4ce31031bda92864212e914257e4f5c1fafa2af6 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -35,8 +35,13 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/savedaction.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
@@ -47,9 +52,41 @@ using namespace ProjectExplorer;
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class CommonOptionsPageWidget : public QWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group);
|
||||||
|
|
||||||
|
GlobalDebuggerOptions globalOptions() const;
|
||||||
|
void setGlobalOptions(const GlobalDebuggerOptions &go);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QCheckBox *checkBoxUseAlternatingRowColors;
|
||||||
|
QCheckBox *checkBoxFontSizeFollowsEditor;
|
||||||
|
QCheckBox *checkBoxUseToolTipsInMainEditor;
|
||||||
|
QCheckBox *checkBoxListSourceFiles;
|
||||||
|
QCheckBox *checkBoxCloseBuffersOnExit;
|
||||||
|
QCheckBox *checkBoxSwitchModeOnExit;
|
||||||
|
QCheckBox *checkBoxBringToForegroundOnInterrrupt;
|
||||||
|
QCheckBox *checkBoxShowQmlObjectTree;
|
||||||
|
QCheckBox *checkBoxBreakpointsFullPath;
|
||||||
|
QCheckBox *checkBoxRegisterForPostMortem;
|
||||||
|
QCheckBox *checkBoxWarnOnReleaseBuilds;
|
||||||
|
QCheckBox *checkBoxKeepEditorStationaryWhileStepping;
|
||||||
|
QLabel *labelMaximalStackDepth;
|
||||||
|
QLabel *labelDisplayStringLimit;
|
||||||
|
QLabel *labelMaximalStringLength;
|
||||||
|
QSpinBox *spinBoxMaximalStackDepth;
|
||||||
|
QSpinBox *spinBoxMaximalStringLength;
|
||||||
|
QSpinBox *spinBoxDisplayStringLimit;
|
||||||
|
|
||||||
|
DebuggerSourcePathMappingWidget *sourcesMappingWidget;
|
||||||
|
const QSharedPointer<Utils::SavedActionSet> m_group;
|
||||||
|
};
|
||||||
|
|
||||||
CommonOptionsPageWidget::CommonOptionsPageWidget
|
CommonOptionsPageWidget::CommonOptionsPageWidget
|
||||||
(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent)
|
(const QSharedPointer<Utils::SavedActionSet> &group)
|
||||||
: QWidget(parent), m_group(group)
|
: m_group(group)
|
||||||
{
|
{
|
||||||
QGroupBox *behaviorBox = new QGroupBox(this);
|
QGroupBox *behaviorBox = new QGroupBox(this);
|
||||||
behaviorBox->setTitle(tr("Behavior"));
|
behaviorBox->setTitle(tr("Behavior"));
|
||||||
@@ -309,6 +346,7 @@ QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *functio
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// LocalsAndExpressionsOptionsPage
|
// LocalsAndExpressionsOptionsPage
|
||||||
@@ -340,28 +378,62 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
|
|||||||
{
|
{
|
||||||
if (!m_widget) {
|
if (!m_widget) {
|
||||||
m_widget = new QWidget;
|
m_widget = new QWidget;
|
||||||
m_ui.setupUi(m_widget);
|
|
||||||
|
|
||||||
m_group.clear();
|
|
||||||
DebuggerCore *dc = debuggerCore();
|
DebuggerCore *dc = debuggerCore();
|
||||||
|
|
||||||
m_group.insert(dc->action(UseDebuggingHelpers),
|
QGroupBox *debuggingHelperGroupBox = new QGroupBox(m_widget);
|
||||||
m_ui.debuggingHelperGroupBox);
|
debuggingHelperGroupBox->setTitle(tr("Use Debugging Helper"));
|
||||||
|
debuggingHelperGroupBox->setCheckable(true);
|
||||||
|
|
||||||
m_group.insert(dc->action(UseCodeModel),
|
QLabel *label = new QLabel(debuggingHelperGroupBox);
|
||||||
m_ui.checkBoxUseCodeModel);
|
label->setTextFormat(Qt::AutoText);
|
||||||
m_ui.checkBoxUseCodeModel->setToolTip(dc->action(UseCodeModel)->toolTip());
|
label->setWordWrap(true);
|
||||||
|
label->setText(QLatin1String("<html><head/><body>\n<p>")
|
||||||
|
+ tr("The debugging helper is only used to produce a nice "
|
||||||
|
"display of objects of certain types like QString or "
|
||||||
|
"std::map in the "Locals and Expressions" view. "
|
||||||
|
"It is not strictly necessary for debugging with Qt Creator.")
|
||||||
|
+ QLatin1String("</p></body></html>"));
|
||||||
|
|
||||||
m_group.insert(dc->action(ShowThreadNames),
|
QCheckBox *checkBoxUseCodeModel = new QCheckBox(debuggingHelperGroupBox);
|
||||||
m_ui.checkBoxShowThreadNames);
|
checkBoxUseCodeModel->setText(tr("Use code model"));
|
||||||
m_group.insert(dc->action(ShowStdNamespace), m_ui.checkBoxShowStdNamespace);
|
checkBoxUseCodeModel->setToolTip(dc->action(UseCodeModel)->toolTip());
|
||||||
m_group.insert(dc->action(ShowQtNamespace), m_ui.checkBoxShowQtNamespace);
|
checkBoxUseCodeModel->setToolTip(tr("Makes use of Qt Creator's code model "
|
||||||
|
"to find out if a variable has already been assigned a "
|
||||||
|
"value at the point the debugger interrupts."));
|
||||||
|
|
||||||
|
QCheckBox *checkBoxShowThreadNames = new QCheckBox(debuggingHelperGroupBox);
|
||||||
|
checkBoxShowThreadNames->setToolTip(tr("Displays names of QThread based threads."));
|
||||||
|
checkBoxShowThreadNames->setText(tr("Display thread names"));
|
||||||
|
|
||||||
|
QCheckBox *checkBoxShowStdNamespace = new QCheckBox(m_widget);
|
||||||
|
checkBoxShowStdNamespace->setToolTip(tr("Shows 'std::' prefix for types from the standard library."));
|
||||||
|
checkBoxShowStdNamespace->setText(tr("Show \"std::\" namespace for types"));
|
||||||
|
|
||||||
|
QCheckBox *checkBoxShowQtNamespace = new QCheckBox(m_widget);
|
||||||
|
checkBoxShowQtNamespace->setToolTip(tr("Shows Qt namespace prefix for Qt types. This is only relevant if Qt was configured with '-qtnamespace'."));
|
||||||
|
checkBoxShowQtNamespace->setText(tr("Qt's namespace for types"));
|
||||||
|
|
||||||
|
QVBoxLayout *verticalLayout = new QVBoxLayout(debuggingHelperGroupBox);
|
||||||
|
verticalLayout->addWidget(label);
|
||||||
|
verticalLayout->addWidget(checkBoxUseCodeModel);
|
||||||
|
verticalLayout->addWidget(checkBoxShowThreadNames);
|
||||||
|
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout(m_widget);
|
||||||
|
layout->addWidget(debuggingHelperGroupBox);
|
||||||
|
layout->addWidget(checkBoxShowStdNamespace);
|
||||||
|
layout->addWidget(checkBoxShowQtNamespace);
|
||||||
|
layout->addStretch();
|
||||||
|
|
||||||
|
m_group.clear();
|
||||||
|
m_group.insert(dc->action(UseDebuggingHelpers), debuggingHelperGroupBox);
|
||||||
|
m_group.insert(dc->action(UseCodeModel), checkBoxUseCodeModel);
|
||||||
|
m_group.insert(dc->action(ShowThreadNames), checkBoxShowThreadNames);
|
||||||
|
m_group.insert(dc->action(ShowStdNamespace), checkBoxShowStdNamespace);
|
||||||
|
m_group.insert(dc->action(ShowQtNamespace), checkBoxShowQtNamespace);
|
||||||
|
|
||||||
#ifndef QT_DEBUG
|
#ifndef QT_DEBUG
|
||||||
#if 0
|
#if 0
|
||||||
cmd = am->registerAction(m_dumpLogAction,
|
cmd = am->registerAction(m_dumpLogAction, DUMP_LOG, globalcontext);
|
||||||
DUMP_LOG, globalcontext);
|
|
||||||
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
|
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
|
||||||
cmd->setDefaultKeySequence(QKeySequence(QCoreApplication::translate("Debugger", "Ctrl+Shift+F11")));
|
cmd->setDefaultKeySequence(QKeySequence(QCoreApplication::translate("Debugger", "Ctrl+Shift+F11")));
|
||||||
mdebug->addAction(cmd);
|
mdebug->addAction(cmd);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#define DEBUGGER_COMMONOPTIONSPAGE_H
|
#define DEBUGGER_COMMONOPTIONSPAGE_H
|
||||||
|
|
||||||
#include "debuggersourcepathmappingwidget.h"
|
#include "debuggersourcepathmappingwidget.h"
|
||||||
#include "ui_localsandexpressionsoptionspage.h"
|
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
#include <utils/savedaction.h>
|
#include <utils/savedaction.h>
|
||||||
@@ -47,6 +46,7 @@ namespace Debugger {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GlobalDebuggerOptions;
|
class GlobalDebuggerOptions;
|
||||||
|
class CommonOptionsPageWidget;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@@ -54,39 +54,6 @@ class GlobalDebuggerOptions;
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class CommonOptionsPageWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent = 0);
|
|
||||||
|
|
||||||
GlobalDebuggerOptions globalOptions() const;
|
|
||||||
void setGlobalOptions(const GlobalDebuggerOptions &go);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QCheckBox *checkBoxUseAlternatingRowColors;
|
|
||||||
QCheckBox *checkBoxFontSizeFollowsEditor;
|
|
||||||
QCheckBox *checkBoxUseToolTipsInMainEditor;
|
|
||||||
QCheckBox *checkBoxListSourceFiles;
|
|
||||||
QCheckBox *checkBoxCloseBuffersOnExit;
|
|
||||||
QCheckBox *checkBoxSwitchModeOnExit;
|
|
||||||
QCheckBox *checkBoxBringToForegroundOnInterrrupt;
|
|
||||||
QCheckBox *checkBoxShowQmlObjectTree;
|
|
||||||
QCheckBox *checkBoxBreakpointsFullPath;
|
|
||||||
QCheckBox *checkBoxRegisterForPostMortem;
|
|
||||||
QCheckBox *checkBoxWarnOnReleaseBuilds;
|
|
||||||
QCheckBox *checkBoxKeepEditorStationaryWhileStepping;
|
|
||||||
QLabel *labelMaximalStackDepth;
|
|
||||||
QLabel *labelDisplayStringLimit;
|
|
||||||
QLabel *labelMaximalStringLength;
|
|
||||||
QSpinBox *spinBoxMaximalStackDepth;
|
|
||||||
QSpinBox *spinBoxMaximalStringLength;
|
|
||||||
QSpinBox *spinBoxDisplayStringLimit;
|
|
||||||
|
|
||||||
DebuggerSourcePathMappingWidget *sourcesMappingWidget;
|
|
||||||
const QSharedPointer<Utils::SavedActionSet> m_group;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CommonOptionsPage : public Core::IOptionsPage
|
class CommonOptionsPage : public Core::IOptionsPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -129,7 +96,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<QWidget> m_widget;
|
QPointer<QWidget> m_widget;
|
||||||
Ui::DebuggingHelperOptionPage m_ui;
|
|
||||||
Utils::SavedActionSet m_group;
|
Utils::SavedActionSet m_group;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -133,9 +133,6 @@ SOURCES += \
|
|||||||
simplifytype.cpp \
|
simplifytype.cpp \
|
||||||
unstartedappwatcherdialog.cpp
|
unstartedappwatcherdialog.cpp
|
||||||
|
|
||||||
FORMS += \
|
|
||||||
localsandexpressionsoptionspage.ui
|
|
||||||
|
|
||||||
RESOURCES += debugger.qrc
|
RESOURCES += debugger.qrc
|
||||||
|
|
||||||
false {
|
false {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ QtcPlugin {
|
|||||||
"disassemblerlines.cpp", "disassemblerlines.h",
|
"disassemblerlines.cpp", "disassemblerlines.h",
|
||||||
"imageviewer.cpp", "imageviewer.h",
|
"imageviewer.cpp", "imageviewer.h",
|
||||||
"loadcoredialog.cpp", "loadcoredialog.h",
|
"loadcoredialog.cpp", "loadcoredialog.h",
|
||||||
"localsandexpressionsoptionspage.ui",
|
|
||||||
"localsandexpressionswindow.cpp", "localsandexpressionswindow.h",
|
"localsandexpressionswindow.cpp", "localsandexpressionswindow.h",
|
||||||
"logwindow.cpp", "logwindow.h",
|
"logwindow.cpp", "logwindow.h",
|
||||||
"memoryagent.cpp", "memoryagent.h",
|
"memoryagent.cpp", "memoryagent.h",
|
||||||
|
|||||||
@@ -108,9 +108,12 @@
|
|||||||
#include <utils/statuslabel.h>
|
#include <utils/statuslabel.h>
|
||||||
#include <utils/winutils.h>
|
#include <utils/winutils.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QHeaderView>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|||||||
@@ -35,9 +35,11 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
#include <QLabel>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
|
|
||||||
|
|||||||
@@ -1,97 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Debugger::Internal::DebuggingHelperOptionPage</class>
|
|
||||||
<widget class="QWidget" name="Debugger::Internal::DebuggingHelperOptionPage">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>529</width>
|
|
||||||
<height>303</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="debuggingHelperGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Use Debugging Helper</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string><html><head/><body>
|
|
||||||
<p>The debugging helper is only used to produce a nice display of objects of certain types like QString or std::map in the &quot;Locals and Expressions&quot; view. It is not strictly necessary for debugging with Qt Creator. </p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::AutoText</enum>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxUseCodeModel">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Makes use of Qt Creator's code model to find out if a variable has already been assigned a value at the point the debugger interrupts.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Use code model</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxShowThreadNames">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Displays names of QThread based threads.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Display thread names</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxShowStdNamespace">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Shows 'std::' prefix for types from the standard library.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Show "std::" namespace for types</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxShowQtNamespace">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Shows Qt namespace prefix for Qt types. This is only relevant if Qt was configured with '-qtnamespace'.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Show Qt's namespace for types</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>10</width>
|
|
||||||
<height>1</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
Reference in New Issue
Block a user