///////////////////////////////////////////////////////////////////////
BreakWindow::BreakWindow(QWidget *parent)
- : QTreeView(parent)
+ : QTreeView(parent)
{
- m_alwaysResizeColumnsToContents = false;
-
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
setFrameStyle(QFrame::NoFrame);
setAttribute(Qt::WA_MacShowFocusRect, false);
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)
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());
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));
deleteBreakpoints(breakpointsInFile);
else if (act == adjustColumnAction)
resizeColumnsToContents();
- else if (act == alwaysAdjustAction)
- setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == editBreakpointAction)
editBreakpoints(selectedIds);
else if (act == associateBreakpointAction)
void BreakWindow::setAlwaysResizeColumnsToContents(bool on)
{
- m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
for (int i = model()->columnCount(); --i >= 0; )
void editBreakpoints(const BreakpointIds &ids);
void associateBreakpoint(const BreakpointIds &ids, int thread);
void setBreakpointsEnabled(const BreakpointIds &ids, bool enabled);
-
- bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal
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)),
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);
// 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);
+ 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);
- insertItem(AlwaysAdjustColumnWidths, item);
+ 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"));
{
// General
SettingsDialog,
- AdjustColumnWidths,
- AlwaysAdjustColumnWidths,
UseAlternatingRowColors,
UseMessageBoxForSignals,
AutoQuit,
MaximalStackDepth,
ExpandStack,
CreateFullBacktrace,
+ AlwaysAdjustStackColumnWidths,
// Watchers & Locals
ShowStdNamespace,
ShowQtNamespace,
SortStructMembers,
AutoDerefPointers,
+ AlwaysAdjustLocalsColumnWidths,
// Source List
ListSourceFiles,
AllPluginBreakpoints,
SelectedPluginBreakpoints,
AdjustBreakpointLocations,
+ AlwaysAdjustBreakpointsColumnWidths,
NoPluginBreakpoints,
SelectedPluginBreakpointsPattern,
BreakOnThrow,
- BreakOnCatch
+ BreakOnCatch,
+
+ // Registers
+ AlwaysAdjustRegistersColumnWidths,
+
+ // Snapshots
+ AlwaysAdjustSnapshotsColumnWidths,
+
+ // Threads
+ AlwaysAdjustThreadsColumnWidths,
+
+ // Modules
+ AlwaysAdjustModulesColumnWidths
};
} // namespace Internal
namespace Internal {
ModulesWindow::ModulesWindow(QWidget *parent)
- : QTreeView(parent), m_alwaysResizeColumnsToContents(false)
+ : QTreeView(parent)
{
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
setWindowTitle(tr("Modules"));
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)
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));
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));
}
void ModulesWindow::setAlwaysResizeColumnsToContents(bool on)
{
- m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
private:
void contextMenuEvent(QContextMenuEvent *ev);
void setModel(QAbstractItemModel *model);
-
- bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal
///////////////////////////////////////////////////////////////////////
RegisterWindow::RegisterWindow(QWidget *parent)
- : QTreeView(parent), m_alwaysResizeColumnsToContents(true)
+ : QTreeView(parent)
{
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
setFrameStyle(QFrame::NoFrame);
connect(act, SIGNAL(toggled(bool)),
SLOT(setAlternatingRowColorsHelper(bool)));
+ connect(debuggerCore()->action(AlwaysAdjustRegistersColumnWidths),
+ SIGNAL(toggled(bool)),
+ SLOT(setAlwaysResizeColumnsToContents(bool)));
}
void RegisterWindow::resizeEvent(QResizeEvent *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));
if (act == actAdjust)
resizeColumnsToContents();
- else if (act == actAlwaysAdjust)
- setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == actReload)
engine->reloadRegisters();
else if (act == actShowMemory)
void RegisterWindow::setAlwaysResizeColumnsToContents(bool on)
{
- m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
private:
void resizeEvent(QResizeEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev);
-
- bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal
///////////////////////////////////////////////////////////////////////
SnapshotWindow::SnapshotWindow(SnapshotHandler *handler)
- : m_alwaysResizeColumnsToContents(false)
{
m_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)
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));
removeSnapshot(idx.row());
else if (act == actAdjust)
resizeColumnsToContents();
- else if (act == actAlwaysAdjust)
- setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
}
void SnapshotWindow::removeSnapshot(int i)
void SnapshotWindow::setAlwaysResizeColumnsToContents(bool on)
{
- m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode =
on ? QHeaderView::ResizeToContents : QHeaderView::Interactive;
for (int i = model()->columnCount(); --i >= 0; )
void keyPressEvent(QKeyEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev);
- bool m_alwaysResizeColumnsToContents;
SnapshotHandler *m_snapshotHandler;
};
}
StackWindow::StackWindow(QWidget *parent)
- : QTreeView(parent), m_alwaysResizeColumnsToContents(false)
+ : QTreeView(parent)
{
setAttribute(Qt::WA_MacShowFocusRect, false);
setFrameStyle(QFrame::NoFrame);
SLOT(reloadFullStack()));
connect(debuggerCore()->action(MaximalStackDepth), SIGNAL(triggered()),
SLOT(reloadFullStack()));
+ connect(debuggerCore()->action(AlwaysAdjustStackColumnWidths),
+ SIGNAL(triggered(bool)),
+ SLOT(setAlwaysResizeColumnsToContents(bool)));
showAddressColumn(false);
}
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));
copyContentsToClipboard();
else if (act == actAdjust)
resizeColumnsToContents();
- else if (act == actAlwaysAdjust)
- setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == actShowMemory)
engine->openMemoryView(address);
else if (act == actShowDisassembler)
void StackWindow::setAlwaysResizeColumnsToContents(bool on)
{
- m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode =
on ? QHeaderView::ResizeToContents : QHeaderView::Interactive;
for (int i = model()->columnCount(); --i >= 0; )
void setModel(QAbstractItemModel *model);
void contextMenuEvent(QContextMenuEvent *ev);
void copyContentsToClipboard();
-
- bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal
namespace Internal {
ThreadsWindow::ThreadsWindow(QWidget *parent)
- : QTreeView(parent), m_alwaysResizeColumnsToContents(false)
+ : QTreeView(parent)
{
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
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)
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));
if (!act)
return;
- if (act == adjustColumnAction) {
+ if (act == adjustColumnAction)
resizeColumnsToContents();
- } else if (act == alwaysAdjustColumnAction) {
- setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
- }
}
void ThreadsWindow::resizeColumnsToContents()
void ThreadsWindow::setAlwaysResizeColumnsToContents(bool on)
{
- m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
private:
void setModel(QAbstractItemModel *model);
void contextMenuEvent(QContextMenuEvent *ev);
-
- bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal
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));
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)
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
if (act == actAdjustColumnWidths) {
resizeColumnsToContents();
- } else if (act == actAlwaysAdjustColumnWidth) {
- setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
} else if (act == actInsertNewWatchItem) {
watchExpression(QString());
} else if (act == actOpenMemoryEditAtVariableAddress) {
{
if (!header())
return;
- m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
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)));
public slots:
void resizeColumnsToContents();
- void setAlwaysResizeColumnsToContents(bool on = true);
void setModel(QAbstractItemModel *model);
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
void watchExpression(const QString &exp);
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);
void setModelData(int role, const QVariant &value = QVariant(),
const QModelIndex &index = QModelIndex());
- bool m_alwaysResizeColumnsToContents;
Type m_type;
bool m_grabbing;
};