forked from qt-creator/qt-creator
Debugger: Some view resizeing fine-tuning
Change-Id: I5ad041e658089ed3f965cf5fb77fda00571389b9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -93,20 +93,18 @@ void BaseTreeView::setModel(QAbstractItemModel *model)
|
|||||||
void BaseTreeView::connectColumnAdjustment()
|
void BaseTreeView::connectColumnAdjustment()
|
||||||
{
|
{
|
||||||
if (m_alwaysAdjustColumns && model()) {
|
if (m_alwaysAdjustColumns && model()) {
|
||||||
connect(model(), SIGNAL(layoutChanged()), this, SLOT(resizeColumns()));
|
|
||||||
connect(model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(resizeColumns()));
|
|
||||||
connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(resizeColumns()));
|
connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(resizeColumns()));
|
||||||
connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(resizeColumns()));
|
connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(resizeColumns()));
|
||||||
|
connect(model(), SIGNAL(layoutChanged()), this, SLOT(resizeColumns()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseTreeView::disconnectColumnAdjustment()
|
void BaseTreeView::disconnectColumnAdjustment()
|
||||||
{
|
{
|
||||||
if (m_alwaysAdjustColumns && model()) {
|
if (m_alwaysAdjustColumns && model()) {
|
||||||
disconnect(model(), SIGNAL(layoutChanged()), this, SLOT(resizeColumns()));
|
|
||||||
disconnect(model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(resizeColumns()));
|
|
||||||
disconnect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(resizeColumns()));
|
disconnect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(resizeColumns()));
|
||||||
disconnect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(resizeColumns()));
|
disconnect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(resizeColumns()));
|
||||||
|
disconnect(model(), SIGNAL(layoutChanged()), this, SLOT(resizeColumns()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ public slots:
|
|||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
void resizeColumns();
|
void resizeColumns();
|
||||||
void resizeColumnsFinish();
|
|
||||||
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
|
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
|
||||||
void setAlwaysAdjustColumns(bool on);
|
void setAlwaysAdjustColumns(bool on);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void resizeColumnsFinish();
|
||||||
void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); }
|
void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); }
|
||||||
void rowClickedHelper(const QModelIndex &index) { rowClicked(index); }
|
void rowClickedHelper(const QModelIndex &index) { rowClicked(index); }
|
||||||
void toggleColumnWidth(int logicalIndex);
|
void toggleColumnWidth(int logicalIndex);
|
||||||
|
|||||||
@@ -530,17 +530,20 @@ public:
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static QWidget *addSearch(BaseTreeView *treeView, const QString &title, const char *objectName)
|
static QWidget *addSearch(BaseTreeView *treeView, const QString &title,
|
||||||
|
const char *objectName, bool adjustColumns = false)
|
||||||
{
|
{
|
||||||
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
||||||
treeView->setAlternatingRowColors(act->isChecked());
|
treeView->setAlternatingRowColors(act->isChecked());
|
||||||
QObject::connect(act, SIGNAL(toggled(bool)),
|
QObject::connect(act, SIGNAL(toggled(bool)),
|
||||||
treeView, SLOT(setAlternatingRowColorsHelper(bool)));
|
treeView, SLOT(setAlternatingRowColorsHelper(bool)));
|
||||||
|
|
||||||
act = debuggerCore()->action(AlwaysAdjustColumnWidths);
|
if (adjustColumns) {
|
||||||
treeView->setAlwaysAdjustColumns(act->isChecked());
|
act = debuggerCore()->action(AlwaysAdjustColumnWidths);
|
||||||
QObject::connect(act, SIGNAL(toggled(bool)),
|
treeView->setAlwaysAdjustColumns(act->isChecked());
|
||||||
|
QObject::connect(act, SIGNAL(toggled(bool)),
|
||||||
treeView, SLOT(setAlwaysAdjustColumns(bool)));
|
treeView, SLOT(setAlwaysAdjustColumns(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *widget = TreeViewFind::createSearchableWrapper(treeView);
|
QWidget *widget = TreeViewFind::createSearchableWrapper(treeView);
|
||||||
widget->setObjectName(QLatin1String(objectName));
|
widget->setObjectName(QLatin1String(objectName));
|
||||||
@@ -2817,16 +2820,16 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
|||||||
m_threadsWindow = addSearch(m_threadsView, tr("Threads"), DOCKWIDGET_THREADS);
|
m_threadsWindow = addSearch(m_threadsView, tr("Threads"), DOCKWIDGET_THREADS);
|
||||||
|
|
||||||
m_returnView = new WatchTreeView(ReturnType);
|
m_returnView = new WatchTreeView(ReturnType);
|
||||||
m_returnWindow = addSearch(m_returnView, tr("Locals and Expressions"), "CppDebugReturn");
|
m_returnWindow = addSearch(m_returnView, tr("Locals and Expressions"), "CppDebugReturn", true);
|
||||||
|
|
||||||
m_localsView = new WatchTreeView(LocalsType);
|
m_localsView = new WatchTreeView(LocalsType);
|
||||||
m_localsWindow = addSearch(m_localsView, tr("Locals and Expressions"), "CppDebugLocals");
|
m_localsWindow = addSearch(m_localsView, tr("Locals and Expressions"), "CppDebugLocals", true);
|
||||||
|
|
||||||
m_watchersView = new WatchTreeView(WatchersType);
|
m_watchersView = new WatchTreeView(WatchersType);
|
||||||
m_watchersWindow = addSearch(m_watchersView, tr("Locals and Expressions"), "CppDebugWatchers");
|
m_watchersWindow = addSearch(m_watchersView, tr("Locals and Expressions"), "CppDebugWatchers", true);
|
||||||
|
|
||||||
m_inspectorView = new WatchTreeView(InspectType);
|
m_inspectorView = new WatchTreeView(InspectType);
|
||||||
m_inspectorWindow = addSearch(m_inspectorView, tr("Locals and Expressions"), "Inspector");
|
m_inspectorWindow = addSearch(m_inspectorView, tr("Locals and Expressions"), "Inspector", true);
|
||||||
|
|
||||||
// Snapshot
|
// Snapshot
|
||||||
m_snapshotHandler = new SnapshotHandler;
|
m_snapshotHandler = new SnapshotHandler;
|
||||||
|
|||||||
Reference in New Issue
Block a user