diff options
author | hjk <qtc-committer@nokia.com> | 2011-03-16 18:48:14 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2011-03-16 18:49:01 +0100 |
commit | 82b7e9befd0eb6ef32acc1d87b7319c72e1f4bad (patch) | |
tree | 4c7d0255a831ab26a527b9b74b95c796f509e90f /src/plugins/debugger/registerwindow.cpp | |
parent | 429ed63f5d4ebcb338a925318fc154e1e9b1fe00 (diff) | |
download | qt-creator-82b7e9befd0eb6ef32acc1d87b7319c72e1f4bad.tar.gz |
debugger: persist 'AlwaysAdjust*ColumnWidths' settings
Task-number: QTCREATORBUG-2836
Diffstat (limited to 'src/plugins/debugger/registerwindow.cpp')
-rw-r--r-- | src/plugins/debugger/registerwindow.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/debugger/registerwindow.cpp b/src/plugins/debugger/registerwindow.cpp index 4fa281c6b1..68cdddd017 100644 --- a/src/plugins/debugger/registerwindow.cpp +++ b/src/plugins/debugger/registerwindow.cpp @@ -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); |