debugger: make 'address column' in stack and breakpoint view optional

This commit is contained in:
hjk
2009-10-01 11:22:44 +02:00
parent d9d39ab218
commit ccd37a6655
13 changed files with 88 additions and 72 deletions

View File

@@ -69,22 +69,13 @@ StackWindow::StackWindow(DebuggerManager *manager, QWidget *parent)
this, SLOT(rowActivated(QModelIndex)));
connect(act, SIGNAL(toggled(bool)),
this, SLOT(setAlternatingRowColorsHelper(bool)));
connect(theDebuggerAction(UseAddressInStackView), SIGNAL(toggled(bool)),
this, SLOT(showAddressColumn(bool)));
}
void StackWindow::resizeEvent(QResizeEvent *event)
void StackWindow::showAddressColumn(bool on)
{
/*
QHeaderView *hv = header();
int totalSize = event->size().width() - 120;
if (totalSize > 10) {
hv->resizeSection(0, 45);
hv->resizeSection(1, totalSize / 2);
hv->resizeSection(2, totalSize / 2);
hv->resizeSection(3, 55);
}
*/
QTreeView::resizeEvent(event);
setColumnHidden(4, !on);
}
void StackWindow::rowActivated(const QModelIndex &index)
@@ -124,6 +115,9 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
//menu.addAction(theDebuggerAction(UseTooltipsInStackView));
menu.addAction(theDebuggerAction(UseAddressInStackView));
QAction *actAdjust = menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjust =
@@ -171,10 +165,8 @@ void StackWindow::copyContentsToClipboard()
void StackWindow::resizeColumnsToContents()
{
resizeColumnToContents(0);
resizeColumnToContents(1);
resizeColumnToContents(2);
resizeColumnToContents(3);
for (int i = model()->columnCount(); --i >= 0; )
resizeColumnToContents(i);
}
void StackWindow::setAlwaysResizeColumnsToContents(bool on)
@@ -182,10 +174,8 @@ void StackWindow::setAlwaysResizeColumnsToContents(bool on)
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode =
on ? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
header()->setResizeMode(1, mode);
header()->setResizeMode(2, mode);
header()->setResizeMode(3, mode);
for (int i = model()->columnCount(); --i >= 0; )
header()->setResizeMode(i, mode);
}
} // namespace Internal