forked from qt-creator/qt-creator
debugger: persist 'AlwaysAdjust*ColumnWidths' settings
Task-number: QTCREATORBUG-2836
This commit is contained in:
@@ -442,10 +442,8 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned engineCapabilities, QWid
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
BreakWindow::BreakWindow(QWidget *parent)
|
||||
: QTreeView(parent)
|
||||
: QTreeView(parent)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = false;
|
||||
|
||||
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
@@ -463,6 +461,9 @@ BreakWindow::BreakWindow(QWidget *parent)
|
||||
connect(debuggerCore()->action(UseAddressInBreakpointsView),
|
||||
SIGNAL(toggled(bool)),
|
||||
SLOT(showAddressColumn(bool)));
|
||||
connect(debuggerCore()->action(AlwaysAdjustBreakpointsColumnWidths),
|
||||
SIGNAL(toggled(bool)),
|
||||
SLOT(setAlwaysResizeColumnsToContents(bool)));
|
||||
}
|
||||
|
||||
void BreakWindow::showAddressColumn(bool on)
|
||||
@@ -559,12 +560,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
QAction *adjustColumnAction =
|
||||
new QAction(tr("Adjust Column Widths to Contents"), &menu);
|
||||
|
||||
QAction *alwaysAdjustAction =
|
||||
new QAction(tr("Always Adjust Column Widths to Contents"), &menu);
|
||||
|
||||
alwaysAdjustAction->setCheckable(true);
|
||||
alwaysAdjustAction->setChecked(m_alwaysResizeColumnsToContents);
|
||||
|
||||
QAction *editBreakpointAction =
|
||||
new QAction(tr("Edit Breakpoint..."), &menu);
|
||||
editBreakpointAction->setEnabled(!selectedIds.isEmpty());
|
||||
@@ -610,7 +605,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
menu.addAction(debuggerCore()->action(UseToolTipsInBreakpointsView));
|
||||
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
|
||||
menu.addAction(adjustColumnAction);
|
||||
menu.addAction(alwaysAdjustAction);
|
||||
menu.addAction(debuggerCore()->action(AlwaysAdjustBreakpointsColumnWidths));
|
||||
menu.addSeparator();
|
||||
menu.addAction(debuggerCore()->action(SettingsDialog));
|
||||
|
||||
@@ -624,8 +619,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
deleteBreakpoints(breakpointsInFile);
|
||||
else if (act == adjustColumnAction)
|
||||
resizeColumnsToContents();
|
||||
else if (act == alwaysAdjustAction)
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
else if (act == editBreakpointAction)
|
||||
editBreakpoints(selectedIds);
|
||||
else if (act == associateBreakpointAction)
|
||||
@@ -729,7 +722,6 @@ void BreakWindow::resizeColumnsToContents()
|
||||
|
||||
void BreakWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode = on
|
||||
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
for (int i = model()->columnCount(); --i >= 0; )
|
||||
|
||||
@@ -70,8 +70,6 @@ private:
|
||||
void editBreakpoints(const BreakpointIds &ids);
|
||||
void associateBreakpoint(const BreakpointIds &ids, int thread);
|
||||
void setBreakpointsEnabled(const BreakpointIds &ids, bool enabled);
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -54,38 +54,47 @@ using namespace ProjectExplorer;
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
CommonOptionsPageWidget::CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent) :
|
||||
QWidget(parent), m_group(group)
|
||||
CommonOptionsPageWidget::CommonOptionsPageWidget
|
||||
(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent)
|
||||
: QWidget(parent), m_group(group)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
DebuggerCore *dc = debuggerCore();
|
||||
m_group->clear();
|
||||
|
||||
m_group->insert(debuggerCore()->action(ListSourceFiles),
|
||||
m_group->insert(dc->action(ListSourceFiles),
|
||||
m_ui.checkBoxListSourceFiles);
|
||||
m_group->insert(debuggerCore()->action(UseAlternatingRowColors),
|
||||
m_group->insert(dc->action(UseAlternatingRowColors),
|
||||
m_ui.checkBoxUseAlternatingRowColors);
|
||||
m_group->insert(debuggerCore()->action(UseToolTipsInMainEditor),
|
||||
m_group->insert(dc->action(UseToolTipsInMainEditor),
|
||||
m_ui.checkBoxUseToolTipsInMainEditor);
|
||||
m_group->insert(debuggerCore()->action(CloseBuffersOnExit),
|
||||
m_group->insert(dc->action(CloseBuffersOnExit),
|
||||
m_ui.checkBoxCloseBuffersOnExit);
|
||||
m_group->insert(debuggerCore()->action(SwitchModeOnExit),
|
||||
m_group->insert(dc->action(SwitchModeOnExit),
|
||||
m_ui.checkBoxSwitchModeOnExit);
|
||||
m_group->insert(debuggerCore()->action(AutoDerefPointers), 0);
|
||||
m_group->insert(debuggerCore()->action(UseToolTipsInLocalsView), 0);
|
||||
m_group->insert(debuggerCore()->action(UseToolTipsInBreakpointsView), 0);
|
||||
m_group->insert(debuggerCore()->action(UseAddressInBreakpointsView), 0);
|
||||
m_group->insert(debuggerCore()->action(UseAddressInStackView), 0);
|
||||
m_group->insert(debuggerCore()->action(MaximalStackDepth),
|
||||
m_group->insert(dc->action(AutoDerefPointers), 0);
|
||||
m_group->insert(dc->action(UseToolTipsInLocalsView), 0);
|
||||
m_group->insert(dc->action(AlwaysAdjustLocalsColumnWidths), 0);
|
||||
m_group->insert(dc->action(AlwaysAdjustThreadsColumnWidths), 0);
|
||||
m_group->insert(dc->action(AlwaysAdjustSnapshotsColumnWidths), 0);
|
||||
m_group->insert(dc->action(AlwaysAdjustBreakpointsColumnWidths), 0);
|
||||
m_group->insert(dc->action(AlwaysAdjustModulesColumnWidths), 0);
|
||||
m_group->insert(dc->action(UseToolTipsInBreakpointsView), 0);
|
||||
m_group->insert(dc->action(UseAddressInBreakpointsView), 0);
|
||||
m_group->insert(dc->action(UseAddressInStackView), 0);
|
||||
m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0);
|
||||
m_group->insert(dc->action(MaximalStackDepth),
|
||||
m_ui.spinBoxMaximalStackDepth);
|
||||
m_group->insert(debuggerCore()->action(ShowStdNamespace), 0);
|
||||
m_group->insert(debuggerCore()->action(ShowQtNamespace), 0);
|
||||
m_group->insert(debuggerCore()->action(SortStructMembers), 0);
|
||||
m_group->insert(debuggerCore()->action(LogTimeStamps), 0);
|
||||
m_group->insert(debuggerCore()->action(VerboseLog), 0);
|
||||
m_group->insert(debuggerCore()->action(BreakOnThrow), 0);
|
||||
m_group->insert(debuggerCore()->action(BreakOnCatch), 0);
|
||||
m_group->insert(dc->action(ShowStdNamespace), 0);
|
||||
m_group->insert(dc->action(ShowQtNamespace), 0);
|
||||
m_group->insert(dc->action(SortStructMembers), 0);
|
||||
m_group->insert(dc->action(LogTimeStamps), 0);
|
||||
m_group->insert(dc->action(VerboseLog), 0);
|
||||
m_group->insert(dc->action(BreakOnThrow), 0);
|
||||
m_group->insert(dc->action(BreakOnCatch), 0);
|
||||
#ifdef Q_OS_WIN
|
||||
Utils::SavedAction *registerAction = debuggerCore()->action(RegisterForPostMortem);
|
||||
Utils::SavedAction *registerAction = dc->action(RegisterForPostMortem);
|
||||
m_group->insert(registerAction,
|
||||
m_ui.checkBoxRegisterForPostMortem);
|
||||
connect(registerAction, SIGNAL(toggled(bool)),
|
||||
@@ -253,26 +262,28 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
|
||||
m_ui.setupUi(w);
|
||||
|
||||
m_ui.dumperLocationChooser->setExpectedKind(Utils::PathChooser::Command);
|
||||
m_ui.dumperLocationChooser->setPromptDialogTitle(QCoreApplication::translate("Debugger",
|
||||
"Choose DebuggingHelper Location"));
|
||||
m_ui.dumperLocationChooser->setPromptDialogTitle(QCoreApplication::translate
|
||||
("Debugger", "Choose DebuggingHelper Location"));
|
||||
m_ui.dumperLocationChooser->setInitialBrowsePathBackup(
|
||||
ICore::instance()->resourcePath() + "../../lib");
|
||||
|
||||
m_group.clear();
|
||||
m_group.insert(debuggerCore()->action(UseDebuggingHelpers),
|
||||
DebuggerCore *dc = debuggerCore();
|
||||
|
||||
m_group.insert(dc->action(UseDebuggingHelpers),
|
||||
m_ui.debuggingHelperGroupBox);
|
||||
m_group.insert(debuggerCore()->action(UseCustomDebuggingHelperLocation),
|
||||
m_group.insert(dc->action(UseCustomDebuggingHelperLocation),
|
||||
m_ui.customLocationGroupBox);
|
||||
// Suppress Oxygen style's giving flat group boxes bold titles.
|
||||
if (oxygenStyle())
|
||||
m_ui.customLocationGroupBox->setStyleSheet(_("QGroupBox::title { font: ; }"));
|
||||
|
||||
m_group.insert(debuggerCore()->action(CustomDebuggingHelperLocation),
|
||||
m_group.insert(dc->action(CustomDebuggingHelperLocation),
|
||||
m_ui.dumperLocationChooser);
|
||||
|
||||
m_group.insert(debuggerCore()->action(UseCodeModel),
|
||||
m_group.insert(dc->action(UseCodeModel),
|
||||
m_ui.checkBoxUseCodeModel);
|
||||
m_group.insert(debuggerCore()->action(ShowThreadNames),
|
||||
m_group.insert(dc->action(ShowThreadNames),
|
||||
m_ui.checkBoxShowThreadNames);
|
||||
|
||||
|
||||
|
||||
@@ -107,14 +107,64 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
// View
|
||||
//
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Adjust Column Widths to Contents"));
|
||||
insertItem(AdjustColumnWidths, item);
|
||||
item->setText(tr("Always Adjust Column Widths to Contents"));
|
||||
item->setCheckable(true);
|
||||
item->setValue(false);
|
||||
item->setDefaultValue(false);
|
||||
item->setSettingsKey(debugModeGroup,
|
||||
QLatin1String("AlwaysAdjustLocalsColumnWidths"));
|
||||
insertItem(AlwaysAdjustLocalsColumnWidths, item);
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Always Adjust Column Widths to Contents"));
|
||||
item->setCheckable(true);
|
||||
insertItem(AlwaysAdjustColumnWidths, item);
|
||||
item->setValue(false);
|
||||
item->setDefaultValue(false);
|
||||
item->setSettingsKey(debugModeGroup,
|
||||
QLatin1String("AlwaysAdjustStackColumnWidths"));
|
||||
insertItem(AlwaysAdjustStackColumnWidths, item);
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Always Adjust Column Widths to Contents"));
|
||||
item->setCheckable(true);
|
||||
item->setValue(false);
|
||||
item->setDefaultValue(false);
|
||||
item->setSettingsKey(debugModeGroup,
|
||||
QLatin1String("AlwaysAdjustThreadsColumnWidths"));
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Always Adjust Column Widths to Contents"));
|
||||
item->setCheckable(true);
|
||||
item->setValue(false);
|
||||
item->setDefaultValue(false);
|
||||
item->setSettingsKey(debugModeGroup,
|
||||
QLatin1String("AlwaysAdjustRegistersColumnWidths"));
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Always Adjust Column Widths to Contents"));
|
||||
item->setCheckable(true);
|
||||
item->setValue(false);
|
||||
item->setDefaultValue(false);
|
||||
item->setSettingsKey(debugModeGroup,
|
||||
QLatin1String("AlwaysAdjustSnapshotsColumnWidths"));
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Always Adjust Column Widths to Contents"));
|
||||
item->setCheckable(true);
|
||||
item->setValue(false);
|
||||
item->setDefaultValue(false);
|
||||
item->setSettingsKey(debugModeGroup,
|
||||
QLatin1String("AlwaysAdjustBreakpointsColumnWidths"));
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Always Adjust Column Widths to Contents"));
|
||||
item->setCheckable(true);
|
||||
item->setValue(false);
|
||||
item->setDefaultValue(false);
|
||||
item->setSettingsKey(debugModeGroup,
|
||||
QLatin1String("AlwaysAdjustModulesColumnWidths"));
|
||||
|
||||
insertItem(AlwaysAdjustStackColumnWidths, item);
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Use Alternating Row Colors"));
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("UseAlternatingRowColours"));
|
||||
|
||||
@@ -90,8 +90,6 @@ enum DebuggerActionCode
|
||||
{
|
||||
// General
|
||||
SettingsDialog,
|
||||
AdjustColumnWidths,
|
||||
AlwaysAdjustColumnWidths,
|
||||
UseAlternatingRowColors,
|
||||
UseMessageBoxForSignals,
|
||||
AutoQuit,
|
||||
@@ -128,12 +126,14 @@ enum DebuggerActionCode
|
||||
MaximalStackDepth,
|
||||
ExpandStack,
|
||||
CreateFullBacktrace,
|
||||
AlwaysAdjustStackColumnWidths,
|
||||
|
||||
// Watchers & Locals
|
||||
ShowStdNamespace,
|
||||
ShowQtNamespace,
|
||||
SortStructMembers,
|
||||
AutoDerefPointers,
|
||||
AlwaysAdjustLocalsColumnWidths,
|
||||
|
||||
// Source List
|
||||
ListSourceFiles,
|
||||
@@ -147,10 +147,23 @@ enum DebuggerActionCode
|
||||
AllPluginBreakpoints,
|
||||
SelectedPluginBreakpoints,
|
||||
AdjustBreakpointLocations,
|
||||
AlwaysAdjustBreakpointsColumnWidths,
|
||||
NoPluginBreakpoints,
|
||||
SelectedPluginBreakpointsPattern,
|
||||
BreakOnThrow,
|
||||
BreakOnCatch
|
||||
BreakOnCatch,
|
||||
|
||||
// Registers
|
||||
AlwaysAdjustRegistersColumnWidths,
|
||||
|
||||
// Snapshots
|
||||
AlwaysAdjustSnapshotsColumnWidths,
|
||||
|
||||
// Threads
|
||||
AlwaysAdjustThreadsColumnWidths,
|
||||
|
||||
// Modules
|
||||
AlwaysAdjustModulesColumnWidths
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
ModulesWindow::ModulesWindow(QWidget *parent)
|
||||
: QTreeView(parent), m_alwaysResizeColumnsToContents(false)
|
||||
: QTreeView(parent)
|
||||
{
|
||||
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
||||
setWindowTitle(tr("Modules"));
|
||||
@@ -73,6 +73,9 @@ ModulesWindow::ModulesWindow(QWidget *parent)
|
||||
SLOT(moduleActivated(QModelIndex)));
|
||||
connect(act, SIGNAL(toggled(bool)),
|
||||
SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
connect(debuggerCore()->action(AlwaysAdjustModulesColumnWidths),
|
||||
SIGNAL(toggled(bool)),
|
||||
SLOT(setAlwaysResizeColumnsToContents(bool)));
|
||||
}
|
||||
|
||||
void ModulesWindow::moduleActivated(const QModelIndex &index)
|
||||
@@ -165,10 +168,7 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
menu.addSeparator();
|
||||
QAction *actAdjustColumnWidths =
|
||||
menu.addAction(tr("Adjust Column Widths to Contents"));
|
||||
QAction *actAlwaysAdjustColumnWidth =
|
||||
menu.addAction(tr("Always Adjust Column Widths to Contents"));
|
||||
actAlwaysAdjustColumnWidth->setCheckable(true);
|
||||
actAlwaysAdjustColumnWidth->setChecked(m_alwaysResizeColumnsToContents);
|
||||
menu.addAction(debuggerCore()->action(AlwaysAdjustModulesColumnWidths));
|
||||
menu.addSeparator();
|
||||
menu.addAction(debuggerCore()->action(SettingsDialog));
|
||||
|
||||
@@ -177,21 +177,19 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
if (act == actUpdateModuleList)
|
||||
engine->reloadModules();
|
||||
else if (act == actAdjustColumnWidths)
|
||||
resizeColumnsToContents();
|
||||
else if (act == actAlwaysAdjustColumnWidth)
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
resizeColumnsToContents();
|
||||
else if (act == actShowModuleSources)
|
||||
engine->loadSymbols(name);
|
||||
engine->loadSymbols(name);
|
||||
else if (act == actLoadSymbolsForAllModules)
|
||||
engine->loadAllSymbols();
|
||||
engine->loadAllSymbols();
|
||||
else if (act == actExamineAllModules)
|
||||
engine->examineModules();
|
||||
engine->examineModules();
|
||||
else if (act == actLoadSymbolsForModule)
|
||||
engine->loadSymbols(name);
|
||||
engine->loadSymbols(name);
|
||||
else if (act == actEditFile)
|
||||
engine->gotoLocation(name);
|
||||
engine->gotoLocation(name);
|
||||
else if (act == actShowModuleSymbols)
|
||||
engine->requestModuleSymbols(name);
|
||||
engine->requestModuleSymbols(name);
|
||||
else if (actShowDependencies && act == actShowDependencies)
|
||||
QProcess::startDetached(QLatin1String("depends"), QStringList(fileName));
|
||||
}
|
||||
@@ -206,7 +204,6 @@ void ModulesWindow::resizeColumnsToContents()
|
||||
|
||||
void ModulesWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode = on
|
||||
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
header()->setResizeMode(0, mode);
|
||||
|
||||
@@ -55,8 +55,6 @@ private slots:
|
||||
private:
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
void setModel(QAbstractItemModel *model);
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
RegisterWindow::RegisterWindow(QWidget *parent)
|
||||
: QTreeView(parent), m_alwaysResizeColumnsToContents(true)
|
||||
: QTreeView(parent)
|
||||
{
|
||||
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
@@ -170,6 +170,9 @@ RegisterWindow::RegisterWindow(QWidget *parent)
|
||||
|
||||
connect(act, SIGNAL(toggled(bool)),
|
||||
SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
connect(debuggerCore()->action(AlwaysAdjustRegistersColumnWidths),
|
||||
SIGNAL(toggled(bool)),
|
||||
SLOT(setAlwaysResizeColumnsToContents(bool)));
|
||||
}
|
||||
|
||||
void RegisterWindow::resizeEvent(QResizeEvent *ev)
|
||||
@@ -223,10 +226,7 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
menu.addSeparator();
|
||||
|
||||
QAction *actAdjust = menu.addAction(tr("Adjust Column Widths to Contents"));
|
||||
QAction *actAlwaysAdjust =
|
||||
menu.addAction(tr("Always Adjust Column Widths to Contents"));
|
||||
actAlwaysAdjust->setCheckable(true);
|
||||
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
|
||||
menu.addAction(debuggerCore()->action(AlwaysAdjustRegistersColumnWidths));
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(debuggerCore()->action(SettingsDialog));
|
||||
@@ -235,8 +235,6 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
|
||||
if (act == actAdjust)
|
||||
resizeColumnsToContents();
|
||||
else if (act == actAlwaysAdjust)
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
else if (act == actReload)
|
||||
engine->reloadRegisters();
|
||||
else if (act == actShowMemory)
|
||||
@@ -259,7 +257,6 @@ void RegisterWindow::resizeColumnsToContents()
|
||||
|
||||
void RegisterWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode = on
|
||||
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
header()->setResizeMode(0, mode);
|
||||
|
||||
@@ -56,8 +56,6 @@ public slots:
|
||||
private:
|
||||
void resizeEvent(QResizeEvent *ev);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -58,7 +58,6 @@ namespace Internal {
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
SnapshotWindow::SnapshotWindow(SnapshotHandler *handler)
|
||||
: m_alwaysResizeColumnsToContents(false)
|
||||
{
|
||||
m_snapshotHandler = handler;
|
||||
|
||||
@@ -76,6 +75,9 @@ SnapshotWindow::SnapshotWindow(SnapshotHandler *handler)
|
||||
SLOT(rowActivated(QModelIndex)));
|
||||
connect(act, SIGNAL(toggled(bool)),
|
||||
SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
connect(debuggerCore()->action(AlwaysAdjustSnapshotsColumnWidths),
|
||||
SIGNAL(toggled(bool)),
|
||||
SLOT(setAlwaysResizeColumnsToContents(bool)));
|
||||
}
|
||||
|
||||
void SnapshotWindow::rowActivated(const QModelIndex &index)
|
||||
@@ -107,21 +109,14 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
|
||||
QAction *actCreate = menu.addAction(tr("Create Snapshot"));
|
||||
actCreate->setEnabled(idx.data(SnapshotCapabilityRole).toBool());
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
QAction *actRemove = menu.addAction(tr("Remove Snapshot"));
|
||||
actRemove->setEnabled(idx.isValid());
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
QAction *actAdjust = menu.addAction(tr("Adjust Column Widths to Contents"));
|
||||
|
||||
QAction *actAlwaysAdjust =
|
||||
menu.addAction(tr("Always Adjust Column Widths to Contents"));
|
||||
actAlwaysAdjust->setCheckable(true);
|
||||
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
|
||||
|
||||
menu.addAction(debuggerCore()->action(AlwaysAdjustSnapshotsColumnWidths));
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(debuggerCore()->action(SettingsDialog));
|
||||
@@ -134,8 +129,6 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
removeSnapshot(idx.row());
|
||||
else if (act == actAdjust)
|
||||
resizeColumnsToContents();
|
||||
else if (act == actAlwaysAdjust)
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
}
|
||||
|
||||
void SnapshotWindow::removeSnapshot(int i)
|
||||
@@ -151,7 +144,6 @@ void SnapshotWindow::resizeColumnsToContents()
|
||||
|
||||
void SnapshotWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode =
|
||||
on ? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
for (int i = model()->columnCount(); --i >= 0; )
|
||||
|
||||
@@ -61,7 +61,6 @@ private:
|
||||
void keyPressEvent(QKeyEvent *ev);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
SnapshotHandler *m_snapshotHandler;
|
||||
};
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ static DebuggerEngine *currentEngine()
|
||||
}
|
||||
|
||||
StackWindow::StackWindow(QWidget *parent)
|
||||
: QTreeView(parent), m_alwaysResizeColumnsToContents(false)
|
||||
: QTreeView(parent)
|
||||
{
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
@@ -83,6 +83,9 @@ StackWindow::StackWindow(QWidget *parent)
|
||||
SLOT(reloadFullStack()));
|
||||
connect(debuggerCore()->action(MaximalStackDepth), SIGNAL(triggered()),
|
||||
SLOT(reloadFullStack()));
|
||||
connect(debuggerCore()->action(AlwaysAdjustStackColumnWidths),
|
||||
SIGNAL(triggered(bool)),
|
||||
SLOT(setAlwaysResizeColumnsToContents(bool)));
|
||||
showAddressColumn(false);
|
||||
}
|
||||
|
||||
@@ -154,12 +157,7 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
menu.addAction(debuggerCore()->action(UseAddressInStackView));
|
||||
|
||||
QAction *actAdjust = menu.addAction(tr("Adjust Column Widths to Contents"));
|
||||
|
||||
QAction *actAlwaysAdjust =
|
||||
menu.addAction(tr("Always Adjust Column Widths to Contents"));
|
||||
actAlwaysAdjust->setCheckable(true);
|
||||
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
|
||||
|
||||
menu.addAction(debuggerCore()->action(AlwaysAdjustStackColumnWidths));
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(debuggerCore()->action(SettingsDialog));
|
||||
@@ -172,8 +170,6 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
copyContentsToClipboard();
|
||||
else if (act == actAdjust)
|
||||
resizeColumnsToContents();
|
||||
else if (act == actAlwaysAdjust)
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
else if (act == actShowMemory)
|
||||
engine->openMemoryView(address);
|
||||
else if (act == actShowDisassembler)
|
||||
@@ -215,7 +211,6 @@ void StackWindow::resizeColumnsToContents()
|
||||
|
||||
void StackWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode =
|
||||
on ? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
for (int i = model()->columnCount(); --i >= 0; )
|
||||
|
||||
@@ -60,8 +60,6 @@ private:
|
||||
void setModel(QAbstractItemModel *model);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
void copyContentsToClipboard();
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
ThreadsWindow::ThreadsWindow(QWidget *parent)
|
||||
: QTreeView(parent), m_alwaysResizeColumnsToContents(false)
|
||||
: QTreeView(parent)
|
||||
{
|
||||
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
||||
|
||||
@@ -64,9 +64,12 @@ ThreadsWindow::ThreadsWindow(QWidget *parent)
|
||||
header()->setDefaultAlignment(Qt::AlignLeft);
|
||||
|
||||
connect(this, SIGNAL(activated(QModelIndex)),
|
||||
this, SLOT(rowActivated(QModelIndex)));
|
||||
SLOT(rowActivated(QModelIndex)));
|
||||
connect(act, SIGNAL(toggled(bool)),
|
||||
this, SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
connect(debuggerCore()->action(AlwaysAdjustThreadsColumnWidths),
|
||||
SIGNAL(toggled(bool)),
|
||||
SLOT(setAlwaysResizeColumnsToContents(bool)));
|
||||
}
|
||||
|
||||
void ThreadsWindow::rowActivated(const QModelIndex &index)
|
||||
@@ -87,10 +90,7 @@ void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
QMenu menu;
|
||||
QAction *adjustColumnAction =
|
||||
menu.addAction(tr("Adjust Column Widths to Contents"));
|
||||
QAction *alwaysAdjustColumnAction =
|
||||
menu.addAction(tr("Always Adjust Column Widths to Contents"));
|
||||
alwaysAdjustColumnAction->setCheckable(true);
|
||||
alwaysAdjustColumnAction->setChecked(m_alwaysResizeColumnsToContents);
|
||||
menu.addAction(debuggerCore()->action(AlwaysAdjustThreadsColumnWidths));
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(debuggerCore()->action(SettingsDialog));
|
||||
@@ -99,11 +99,8 @@ void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
if (!act)
|
||||
return;
|
||||
|
||||
if (act == adjustColumnAction) {
|
||||
if (act == adjustColumnAction)
|
||||
resizeColumnsToContents();
|
||||
} else if (act == alwaysAdjustColumnAction) {
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
}
|
||||
}
|
||||
|
||||
void ThreadsWindow::resizeColumnsToContents()
|
||||
@@ -115,7 +112,6 @@ void ThreadsWindow::resizeColumnsToContents()
|
||||
|
||||
void ThreadsWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode = on
|
||||
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
header()->setResizeMode(0, mode);
|
||||
|
||||
@@ -57,8 +57,6 @@ private slots:
|
||||
private:
|
||||
void setModel(QAbstractItemModel *model);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -147,16 +147,13 @@ private:
|
||||
|
||||
WatchWindow::WatchWindow(Type type, QWidget *parent)
|
||||
: QTreeView(parent),
|
||||
m_alwaysResizeColumnsToContents(true),
|
||||
m_type(type)
|
||||
{
|
||||
m_grabbing = false;
|
||||
|
||||
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
setWindowTitle(tr("Locals and Watchers"));
|
||||
setAlternatingRowColors(act->isChecked());
|
||||
setIndentation(indentation() * 9/10);
|
||||
setUniformRowHeights(true);
|
||||
setItemDelegate(new WatchDelegate(this));
|
||||
@@ -164,12 +161,19 @@ WatchWindow::WatchWindow(Type type, QWidget *parent)
|
||||
setAcceptDrops(true);
|
||||
setDropIndicatorShown(true);
|
||||
|
||||
connect(act, SIGNAL(toggled(bool)),
|
||||
this, SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
QAction *useColors = debuggerCore()->action(UseAlternatingRowColors);
|
||||
setAlternatingRowColors(useColors->isChecked());
|
||||
|
||||
QAction *adjustColumns = debuggerCore()->action(AlwaysAdjustLocalsColumnWidths);
|
||||
|
||||
connect(useColors, SIGNAL(toggled(bool)),
|
||||
SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
connect(adjustColumns, SIGNAL(triggered(bool)),
|
||||
SLOT(setAlwaysResizeColumnsToContents(bool)));
|
||||
connect(this, SIGNAL(expanded(QModelIndex)),
|
||||
this, SLOT(expandNode(QModelIndex)));
|
||||
SLOT(expandNode(QModelIndex)));
|
||||
connect(this, SIGNAL(collapsed(QModelIndex)),
|
||||
this, SLOT(collapseNode(QModelIndex)));
|
||||
SLOT(collapseNode(QModelIndex)));
|
||||
}
|
||||
|
||||
void WatchWindow::expandNode(const QModelIndex &idx)
|
||||
@@ -468,12 +472,9 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
|
||||
QAction *actAdjustColumnWidths =
|
||||
menu.addAction(tr("Adjust Column Widths to Contents"));
|
||||
QAction *actAlwaysAdjustColumnWidth =
|
||||
menu.addAction(tr("Always Adjust Column Widths to Contents"));
|
||||
actAlwaysAdjustColumnWidth->setCheckable(true);
|
||||
actAlwaysAdjustColumnWidth->setChecked(m_alwaysResizeColumnsToContents);
|
||||
|
||||
menu.addAction(debuggerCore()->action(AlwaysAdjustLocalsColumnWidths));
|
||||
menu.addSeparator();
|
||||
|
||||
QAction *actClearCodeModelSnapshot
|
||||
= new QAction(tr("Refresh Code Model Snapshot"), &menu);
|
||||
actClearCodeModelSnapshot->setEnabled(actionsEnabled
|
||||
@@ -495,8 +496,6 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
|
||||
if (act == actAdjustColumnWidths) {
|
||||
resizeColumnsToContents();
|
||||
} else if (act == actAlwaysAdjustColumnWidth) {
|
||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||
} else if (act == actInsertNewWatchItem) {
|
||||
watchExpression(QString());
|
||||
} else if (act == actOpenMemoryEditAtVariableAddress) {
|
||||
@@ -566,7 +565,6 @@ void WatchWindow::setAlwaysResizeColumnsToContents(bool on)
|
||||
{
|
||||
if (!header())
|
||||
return;
|
||||
m_alwaysResizeColumnsToContents = on;
|
||||
QHeaderView::ResizeMode mode = on
|
||||
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
|
||||
header()->setResizeMode(0, mode);
|
||||
@@ -594,10 +592,13 @@ void WatchWindow::setModel(QAbstractItemModel *model)
|
||||
QTreeView::setModel(model);
|
||||
|
||||
setRootIsDecorated(true);
|
||||
header()->setDefaultAlignment(Qt::AlignLeft);
|
||||
header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
if (m_type != LocalsType)
|
||||
header()->hide();
|
||||
if (header()) {
|
||||
setAlwaysResizeColumnsToContents(
|
||||
debuggerCore()->boolSetting(AlwaysAdjustLocalsColumnWidths));
|
||||
header()->setDefaultAlignment(Qt::AlignLeft);
|
||||
if (m_type != LocalsType)
|
||||
header()->hide();
|
||||
}
|
||||
|
||||
connect(model, SIGNAL(layoutChanged()), SLOT(resetHelper()));
|
||||
connect(model, SIGNAL(enableUpdates(bool)), SLOT(setUpdatesEnabled(bool)));
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
|
||||
public slots:
|
||||
void resizeColumnsToContents();
|
||||
void setAlwaysResizeColumnsToContents(bool on = true);
|
||||
void setModel(QAbstractItemModel *model);
|
||||
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
|
||||
void watchExpression(const QString &exp);
|
||||
@@ -68,6 +67,7 @@ private:
|
||||
Q_SLOT void expandNode(const QModelIndex &idx);
|
||||
Q_SLOT void collapseNode(const QModelIndex &idx);
|
||||
Q_SLOT void setUpdatesEnabled(bool enable);
|
||||
Q_SLOT void setAlwaysResizeColumnsToContents(bool on);
|
||||
|
||||
void keyPressEvent(QKeyEvent *ev);
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
@@ -84,7 +84,6 @@ private:
|
||||
void setModelData(int role, const QVariant &value = QVariant(),
|
||||
const QModelIndex &index = QModelIndex());
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
Type m_type;
|
||||
bool m_grabbing;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user