Commit 2e4ba82b authored by hjk's avatar hjk
Browse files

debugger: adjust sizes of some well-known columns in some views

parent b976a34e
......@@ -310,6 +310,7 @@ bool BreakpointDialog::showDialog(BreakpointParameters *data)
return true;
}
///////////////////////////////////////////////////////////////////////
//
// BreakWindow
......@@ -376,6 +377,14 @@ void BreakWindow::mouseDoubleClickEvent(QMouseEvent *ev)
QTreeView::mouseDoubleClickEvent(ev);
}
void BreakWindow::setModel(QAbstractItemModel *model)
{
QTreeView::setModel(model);
resizeColumnToContents(0); // Number
resizeColumnToContents(3); // Line
resizeColumnToContents(6); // Ignore count
}
void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
{
QMenu menu;
......
......@@ -45,6 +45,7 @@ public:
explicit BreakWindow(QWidget *parent = 0);
static void editBreakpoint(BreakpointId id, QWidget *parent);
void setModel(QAbstractItemModel *model);
private slots:
void resizeColumnsToContents();
......
......@@ -68,8 +68,6 @@ StackWindow::StackWindow(QWidget *parent)
setIconSize(QSize(10, 10));
header()->setDefaultAlignment(Qt::AlignLeft);
header()->resizeSection(0, 60);
header()->resizeSection(3, 60);
connect(this, SIGNAL(activated(QModelIndex)),
SLOT(rowActivated(QModelIndex)));
......@@ -81,6 +79,7 @@ StackWindow::StackWindow(QWidget *parent)
SLOT(reloadFullStack()));
connect(debuggerCore()->action(MaximalStackDepth), SIGNAL(triggered()),
SLOT(reloadFullStack()));
showAddressColumn(false);
}
void StackWindow::showAddressColumn(bool on)
......@@ -93,6 +92,14 @@ void StackWindow::rowActivated(const QModelIndex &index)
currentEngine()->activateFrame(index.row());
}
void StackWindow::setModel(QAbstractItemModel *model)
{
QTreeView::setModel(model);
//resizeColumnsToContents();
resizeColumnToContents(0);
resizeColumnToContents(3);
}
void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
{
DebuggerEngine *engine = currentEngine();
......
......@@ -53,6 +53,7 @@ private slots:
void reloadFullStack();
private:
void setModel(QAbstractItemModel *model);
void contextMenuEvent(QContextMenuEvent *ev);
void copyContentsToClipboard();
......
......@@ -37,6 +37,7 @@
#include <utils/savedaction.h>
#include <QtCore/QDebug>
#include <QtGui/QContextMenuEvent>
#include <QtGui/QHeaderView>
#include <QtGui/QMenu>
......@@ -69,6 +70,15 @@ void ThreadsWindow::rowActivated(const QModelIndex &index)
debuggerCore()->currentEngine()->selectThread(index.row());
}
void ThreadsWindow::setModel(QAbstractItemModel *model)
{
qDebug() << "SET MODEL";
QTreeView::setModel(model);
resizeColumnToContents(0); // Id
resizeColumnToContents(4); // Line
resizeColumnToContents(6); // Name
}
void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
{
QMenu menu;
......
......@@ -51,6 +51,7 @@ private slots:
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
private:
void setModel(QAbstractItemModel *model);
void contextMenuEvent(QContextMenuEvent *ev);
bool m_alwaysResizeColumnsToContents;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment