debugger: slightly saner behaviour for the threads combobox

Change-Id: I20400b037f00a5dbaf11cbbfb184a5bf526883cc
Reviewed-on: http://codereview.qt.nokia.com/4095
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-09-01 16:36:27 +02:00
committed by hjk
parent 4b3890ee54
commit 60afc7fffa
7 changed files with 58 additions and 25 deletions

View File

@@ -79,9 +79,11 @@ void ThreadsWindow::rowActivated(const QModelIndex &index)
void ThreadsWindow::setModel(QAbstractItemModel *model)
{
QTreeView::setModel(model);
resizeColumnToContents(0); // Id
resizeColumnToContents(4); // Line
resizeColumnToContents(6); // Name
resizeColumnToContents(ThreadData::IdColumn);
resizeColumnToContents(ThreadData::LineColumn);
resizeColumnToContents(ThreadData::NameColumn);
resizeColumnToContents(ThreadData::StateColumn);
resizeColumnToContents(ThreadData::TargetIdColumn);
if (header()) {
bool adjust = debuggerCore()->boolSetting(AlwaysAdjustThreadsColumnWidths);
setAlwaysResizeColumnsToContents(adjust);
@@ -109,7 +111,7 @@ void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
void ThreadsWindow::resizeColumnsToContents()
{
const int columnCount = model()->columnCount();
for (int c = 0 ; c < columnCount; c++)
for (int c = 0 ; c != columnCount; ++c)
resizeColumnToContents(c);
}