diff options
author | hjk <qtc-committer@nokia.com> | 2012-03-22 11:54:49 +0100 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-03-22 12:59:42 +0100 |
commit | 32ec60958dc21dc2ccacce0e320a93e72dd5d379 (patch) | |
tree | b7b32a18b5c2a47e6a1a7bbec635e10bf935b869 /src | |
parent | 22a949b5c137acf2210e0fbf0dff318b45a35271 (diff) | |
download | qt-creator-32ec60958dc21dc2ccacce0e320a93e72dd5d379.tar.gz |
debugger: make views searchable
Change-Id: Icade50bfaa884d88e451e688acf62d6793346628
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/debugger/basewindow.cpp | 79 | ||||
-rw-r--r-- | src/plugins/debugger/basewindow.h | 32 | ||||
-rw-r--r-- | src/plugins/debugger/breakwindow.cpp | 31 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 16 | ||||
-rw-r--r-- | src/plugins/debugger/moduleswindow.cpp | 6 | ||||
-rw-r--r-- | src/plugins/debugger/registerwindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/snapshotwindow.cpp | 13 | ||||
-rw-r--r-- | src/plugins/debugger/sourcefileswindow.cpp | 4 | ||||
-rw-r--r-- | src/plugins/debugger/stackwindow.cpp | 6 | ||||
-rw-r--r-- | src/plugins/debugger/stackwindow.h | 2 | ||||
-rw-r--r-- | src/plugins/debugger/threadswindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/watchwindow.cpp | 41 |
12 files changed, 138 insertions, 96 deletions
diff --git a/src/plugins/debugger/basewindow.cpp b/src/plugins/debugger/basewindow.cpp index 133dc86be0..52fa879f53 100644 --- a/src/plugins/debugger/basewindow.cpp +++ b/src/plugins/debugger/basewindow.cpp @@ -35,39 +35,55 @@ #include "debuggeractions.h" #include "debuggercore.h" +#include <aggregation/aggregate.h> +#include <coreplugin/findplaceholder.h> +#include <find/treeviewfind.h> +#include <utils/qtcassert.h> #include <utils/savedaction.h> -#include <QDebug> #include <QContextMenuEvent> +#include <QDebug> #include <QHeaderView> #include <QMenu> +#include <QVBoxLayout> namespace Debugger { namespace Internal { BaseWindow::BaseWindow(QWidget *parent) - : QTreeView(parent) + : QWidget(parent) { QAction *act = debuggerCore()->action(UseAlternatingRowColors); - setAttribute(Qt::WA_MacShowFocusRect, false); - setFrameStyle(QFrame::NoFrame); - setAlternatingRowColors(act->isChecked()); - setRootIsDecorated(false); - setIconSize(QSize(10, 10)); - setSelectionMode(QAbstractItemView::ExtendedSelection); - setUniformRowHeights(true); + m_treeView = new QTreeView(this); + m_treeView->setAttribute(Qt::WA_MacShowFocusRect, false); + m_treeView->setFrameStyle(QFrame::NoFrame); + m_treeView->setAlternatingRowColors(act->isChecked()); + m_treeView->setRootIsDecorated(false); + m_treeView->setIconSize(QSize(10, 10)); + m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection); + m_treeView->setUniformRowHeights(true); - header()->setDefaultAlignment(Qt::AlignLeft); - header()->setClickable(true); + m_treeView->header()->setDefaultAlignment(Qt::AlignLeft); + m_treeView->header()->setClickable(true); connect(act, SIGNAL(toggled(bool)), SLOT(setAlternatingRowColorsHelper(bool))); - connect(this, SIGNAL(activated(QModelIndex)), + connect(m_treeView, SIGNAL(activated(QModelIndex)), SLOT(rowActivatedHelper(QModelIndex))); - connect(header(), SIGNAL(sectionClicked(int)), + connect(m_treeView->header(), SIGNAL(sectionClicked(int)), SLOT(headerSectionClicked(int))); + QVBoxLayout *vbox = new QVBoxLayout(this); + vbox->setMargin(0); + vbox->setSpacing(0); + vbox->addWidget(m_treeView); + vbox->addWidget(new Core::FindToolBarPlaceHolder(this)); + + Aggregation::Aggregate *agg = new Aggregation::Aggregate; + agg->add(m_treeView); + agg->add(new Find::TreeViewFind(m_treeView)); + m_adjustColumnsAction = new QAction(tr("Adjust Column Widths to Contents"), 0); m_alwaysAdjustColumnsAction = 0; } @@ -108,15 +124,15 @@ bool BaseWindow::handleBaseContextAction(QAction *act) void BaseWindow::setModel(QAbstractItemModel *model) { - QTreeView::setModel(model); - if (header() && m_alwaysAdjustColumnsAction) + m_treeView->setModel(model); + if (m_treeView->header() && m_alwaysAdjustColumnsAction) setAlwaysResizeColumnsToContents(m_alwaysAdjustColumnsAction->isChecked()); } void BaseWindow::mousePressEvent(QMouseEvent *ev) { - QTreeView::mousePressEvent(ev); - if (!indexAt(ev->pos()).isValid()) + QWidget::mousePressEvent(ev); + if (!m_treeView->indexAt(ev->pos()).isValid()) resizeColumnsToContents(); } @@ -131,7 +147,17 @@ void BaseWindow::setAlwaysResizeColumnsToContents(bool on) { QHeaderView::ResizeMode mode = on ? QHeaderView::ResizeToContents : QHeaderView::Interactive; - header()->setResizeMode(0, mode); + m_treeView->header()->setResizeMode(0, mode); +} + +void BaseWindow::setAlternatingRowColorsHelper(bool on) +{ + m_treeView->setAlternatingRowColors(on); +} + +void BaseWindow::rowActivatedHelper(const QModelIndex &index) +{ + rowActivated(index); } void BaseWindow::headerSectionClicked(int logicalIndex) @@ -141,11 +167,24 @@ void BaseWindow::headerSectionClicked(int logicalIndex) void BaseWindow::reset() { - QTreeView::reset(); - if (header() && m_alwaysAdjustColumnsAction + m_treeView->reset(); + if (m_treeView->header() && m_alwaysAdjustColumnsAction && m_alwaysAdjustColumnsAction->isChecked()) resizeColumnsToContents(); } +QModelIndexList BaseWindow::selectedIndices(QContextMenuEvent *ev) +{ + QItemSelectionModel *sm = treeView()->selectionModel(); + QTC_ASSERT(sm, return QModelIndexList()); + QModelIndexList si = sm->selectedIndexes(); + if (ev) { + QModelIndex indexUnderMouse = m_treeView->indexAt(ev->pos()); + if (si.isEmpty() && indexUnderMouse.isValid()) + si.append(indexUnderMouse); + } + return si; +} + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/basewindow.h b/src/plugins/debugger/basewindow.h index 1592df4202..d0ca625351 100644 --- a/src/plugins/debugger/basewindow.h +++ b/src/plugins/debugger/basewindow.h @@ -38,32 +38,40 @@ namespace Debugger { namespace Internal { -class BaseWindow : public QTreeView +class BaseWindow : public QWidget { Q_OBJECT public: BaseWindow(QWidget *parent = 0); + virtual void setModel(QAbstractItemModel *model); + QHeaderView *header() const { return m_treeView->header(); } + QAbstractItemModel *model() const { return m_treeView->model(); } - void setAlwaysAdjustColumnsAction(QAction *action); - void addBaseContextActions(QMenu *menu); - bool handleBaseContextAction(QAction *action); - - void setModel(QAbstractItemModel *model); - virtual void rowActivated(const QModelIndex &) {} - void mousePressEvent(QMouseEvent *ev); - -public slots: +protected slots: void resizeColumnsToContents(); void setAlwaysResizeColumnsToContents(bool on); private slots: - void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); } - void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); } + void setAlternatingRowColorsHelper(bool on); + void rowActivatedHelper(const QModelIndex &index); void headerSectionClicked(int logicalIndex); void reset(); +protected: + void setAlwaysAdjustColumnsAction(QAction *action); + void addBaseContextActions(QMenu *menu); + bool handleBaseContextAction(QAction *action); + + QTreeView *treeView() const { return m_treeView; } + QModelIndex indexAt(const QPoint &p) const { return m_treeView->indexAt(p); } + void resizeColumnToContents(int col) { m_treeView->resizeColumnToContents(col); } + void mousePressEvent(QMouseEvent *ev); + virtual void rowActivated(const QModelIndex &) {} + QModelIndexList selectedIndices(QContextMenuEvent *ev = 0); + private: + QTreeView *m_treeView; QAction *m_alwaysAdjustColumnsAction; QAction *m_adjustColumnsAction; }; diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index 699025a18e..4164be4b18 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -492,7 +492,7 @@ BreakWindow::BreakWindow(QWidget *parent) setWindowTitle(tr("Breakpoints")); setObjectName(QLatin1String("ThreadsWindow")); setWindowIcon(QIcon(QLatin1String(":/debugger/images/debugger_breakpoints.png"))); - setSelectionMode(QAbstractItemView::ExtendedSelection); + treeView()->setSelectionMode(QAbstractItemView::ExtendedSelection); setAlwaysAdjustColumnsAction(debuggerCore()->action(AlwaysAdjustBreakpointsColumnWidths)); connect(debuggerCore()->action(UseAddressInBreakpointsView), SIGNAL(toggled(bool)), SLOT(showAddressColumn(bool))); @@ -500,23 +500,23 @@ BreakWindow::BreakWindow(QWidget *parent) void BreakWindow::showAddressColumn(bool on) { - setColumnHidden(7, !on); + treeView()->setColumnHidden(7, !on); } void BreakWindow::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) { - QItemSelectionModel *sm = selectionModel(); + QItemSelectionModel *sm = treeView()->selectionModel(); QTC_ASSERT(sm, return); QModelIndexList si = sm->selectedIndexes(); if (si.isEmpty()) - si.append(currentIndex()); + si.append(treeView()->currentIndex()); const BreakpointModelIds ids = breakHandler()->findBreakpointsByIndex(si); - int row = qMin(model()->rowCount() - ids.size() - 1, currentIndex().row()); + int row = qMin(model()->rowCount() - ids.size() - 1, treeView()->currentIndex().row()); deleteBreakpoints(ids); - setCurrentIndex(si.at(0).sibling(row, 0)); + treeView()->setCurrentIndex(si.at(0).sibling(row, 0)); } - QTreeView::keyPressEvent(ev); + BaseWindow::keyPressEvent(ev); } void BreakWindow::mouseDoubleClickEvent(QMouseEvent *ev) @@ -526,7 +526,7 @@ void BreakWindow::mouseDoubleClickEvent(QMouseEvent *ev) BreakpointModelId id = breakHandler()->findBreakpointByIndex(indexUnderMouse); editBreakpoints(BreakpointModelIds() << id); } - QTreeView::mouseDoubleClickEvent(ev); + BaseWindow::mouseDoubleClickEvent(ev); } void BreakWindow::setModel(QAbstractItemModel *model) @@ -535,21 +535,16 @@ void BreakWindow::setModel(QAbstractItemModel *model) resizeColumnToContents(0); // Number resizeColumnToContents(3); // Line resizeColumnToContents(6); // Ignore count - connect(model, SIGNAL(layoutChanged()), this, SLOT(expandAll())); + connect(model, SIGNAL(layoutChanged()), treeView(), SLOT(expandAll())); } void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) { QMenu menu; - QItemSelectionModel *sm = selectionModel(); - QTC_ASSERT(sm, return); - QModelIndexList selectedIndices = sm->selectedIndexes(); - QModelIndex indexUnderMouse = indexAt(ev->pos()); - if (selectedIndices.isEmpty() && indexUnderMouse.isValid()) - selectedIndices.append(indexUnderMouse); + QModelIndexList si = selectedIndices(); BreakHandler *handler = breakHandler(); - BreakpointModelIds selectedIds = handler->findBreakpointsByIndex(selectedIndices); + BreakpointModelIds selectedIds = handler->findBreakpointsByIndex(si); const int rowCount = model()->rowCount(); QAction *deleteAction = new QAction(tr("Delete Breakpoint"), &menu); @@ -561,8 +556,8 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) // Delete by file: Find indices of breakpoints of the same file. QAction *deleteByFileAction = 0; BreakpointModelIds breakpointsInFile; - if (indexUnderMouse.isValid()) { - const QModelIndex index = indexUnderMouse.sibling(indexUnderMouse.row(), 2); + if (si.size() == 1) { + const QModelIndex index = si.at(0).sibling(si.at(0).row(), 2); const QString file = index.data().toString(); if (!file.isEmpty()) { for (int i = 0; i != rowCount; ++i) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 0874335570..fcec00c906 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1171,15 +1171,15 @@ public: BreakWindow *m_breakWindow; BreakHandler *m_breakHandler; QtMessageLogWindow *m_qtMessageLogWindow; - QTreeView *m_returnWindow; - QTreeView *m_localsWindow; - QTreeView *m_watchersWindow; - QAbstractItemView *m_registerWindow; - QAbstractItemView *m_modulesWindow; - QAbstractItemView *m_snapshotWindow; + BaseWindow *m_returnWindow; + BaseWindow *m_localsWindow; + BaseWindow *m_watchersWindow; + BaseWindow *m_registerWindow; + BaseWindow *m_modulesWindow; + BaseWindow *m_snapshotWindow; SourceFilesWindow *m_sourceFilesWindow; - QAbstractItemView *m_stackWindow; - QAbstractItemView *m_threadsWindow; + BaseWindow *m_stackWindow; + BaseWindow *m_threadsWindow; LogWindow *m_logWindow; bool m_busy; diff --git a/src/plugins/debugger/moduleswindow.cpp b/src/plugins/debugger/moduleswindow.cpp index 70948ed429..32a0eaf593 100644 --- a/src/plugins/debugger/moduleswindow.cpp +++ b/src/plugins/debugger/moduleswindow.cpp @@ -61,10 +61,10 @@ ModulesWindow::ModulesWindow(QWidget *parent) : BaseWindow(parent) { setWindowTitle(tr("Modules")); - setSortingEnabled(true); + treeView()->setSortingEnabled(true); setAlwaysAdjustColumnsAction(debuggerCore()->action(AlwaysAdjustModulesColumnWidths)); - connect(this, SIGNAL(activated(QModelIndex)), + connect(treeView(), SIGNAL(activated(QModelIndex)), SLOT(moduleActivated(QModelIndex))); } @@ -80,7 +80,7 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev) { QString name; QString fileName; - QModelIndex index = indexAt(ev->pos()); + QModelIndex index = treeView()->indexAt(ev->pos()); if (index.isValid()) index = index.sibling(index.row(), 0); if (index.isValid()) { diff --git a/src/plugins/debugger/registerwindow.cpp b/src/plugins/debugger/registerwindow.cpp index 37608353bd..763f46831b 100644 --- a/src/plugins/debugger/registerwindow.cpp +++ b/src/plugins/debugger/registerwindow.cpp @@ -168,7 +168,7 @@ RegisterWindow::RegisterWindow(QWidget *parent) { setWindowTitle(tr("Registers")); setAlwaysAdjustColumnsAction(debuggerCore()->action(UseAlternatingRowColors)); - setItemDelegate(new RegisterDelegate(this)); + treeView()->setItemDelegate(new RegisterDelegate(this)); setObjectName(QLatin1String("RegisterWindow")); } diff --git a/src/plugins/debugger/snapshotwindow.cpp b/src/plugins/debugger/snapshotwindow.cpp index e29b7c6b2e..5438a6ced6 100644 --- a/src/plugins/debugger/snapshotwindow.cpp +++ b/src/plugins/debugger/snapshotwindow.cpp @@ -71,22 +71,19 @@ void SnapshotWindow::rowActivated(const QModelIndex &index) void SnapshotWindow::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) { - QItemSelectionModel *sm = selectionModel(); - QTC_ASSERT(sm, return); - QModelIndexList si = sm->selectedIndexes(); - if (si.isEmpty()) - si.append(currentIndex().sibling(currentIndex().row(), 0)); - + QModelIndexList si = selectedIndices(); foreach (const QModelIndex &idx, si) if (idx.column() == 0) removeSnapshot(idx.row()); } - QTreeView::keyPressEvent(ev); + BaseWindow::keyPressEvent(ev); } void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev) { - QModelIndex idx = indexAt(ev->pos()); + QModelIndexList si = selectedIndices(ev); + QTC_ASSERT(si.size() == 1, return); + QModelIndex idx = si.at(0); QMenu menu; diff --git a/src/plugins/debugger/sourcefileswindow.cpp b/src/plugins/debugger/sourcefileswindow.cpp index e950ef4665..151995daed 100644 --- a/src/plugins/debugger/sourcefileswindow.cpp +++ b/src/plugins/debugger/sourcefileswindow.cpp @@ -60,7 +60,7 @@ SourceFilesWindow::SourceFilesWindow(QWidget *parent) : BaseWindow(parent) { setWindowTitle(tr("Source Files")); - setSortingEnabled(true); + treeView()->setSortingEnabled(true); } void SourceFilesWindow::rowActivated(const QModelIndex &index) @@ -74,7 +74,7 @@ void SourceFilesWindow::contextMenuEvent(QContextMenuEvent *ev) { DebuggerEngine *engine = debuggerCore()->currentEngine(); QTC_ASSERT(engine, return); - QModelIndex index = indexAt(ev->pos()); + QModelIndex index = treeView()->indexAt(ev->pos()); index = index.sibling(index.row(), 0); QString name = index.data().toString(); bool engineActionsEnabled = engine->debuggerActionsEnabled(); diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp index 038440db88..0dd0bc0cd5 100644 --- a/src/plugins/debugger/stackwindow.cpp +++ b/src/plugins/debugger/stackwindow.cpp @@ -76,7 +76,7 @@ StackWindow::StackWindow(QWidget *parent) void StackWindow::showAddressColumn(bool on) { - setColumnHidden(4, !on); + treeView()->setColumnHidden(4, !on); } void StackWindow::rowActivated(const QModelIndex &index) @@ -121,9 +121,11 @@ static inline StackFrame inputFunctionForDisassembly() void StackWindow::contextMenuEvent(QContextMenuEvent *ev) { + QModelIndexList si = selectedIndices(ev); + QTC_ASSERT(si.size() == 1, return); DebuggerEngine *engine = currentEngine(); StackHandler *handler = engine->stackHandler(); - const QModelIndex index = indexAt(ev->pos()); + const QModelIndex index = si.at(0); const int row = index.row(); StackFrame frame; if (row >= 0 && row < handler->stackSize()) diff --git a/src/plugins/debugger/stackwindow.h b/src/plugins/debugger/stackwindow.h index 1e7e73b942..d6115b455f 100644 --- a/src/plugins/debugger/stackwindow.h +++ b/src/plugins/debugger/stackwindow.h @@ -52,8 +52,8 @@ private slots: private: void rowActivated(const QModelIndex &index); void setModel(QAbstractItemModel *model); - void contextMenuEvent(QContextMenuEvent *ev); void copyContentsToClipboard(); + void contextMenuEvent(QContextMenuEvent *ev); }; } // namespace Internal diff --git a/src/plugins/debugger/threadswindow.cpp b/src/plugins/debugger/threadswindow.cpp index d3065fa0ab..d5c80f0bf7 100644 --- a/src/plugins/debugger/threadswindow.cpp +++ b/src/plugins/debugger/threadswindow.cpp @@ -52,7 +52,7 @@ ThreadsWindow::ThreadsWindow(QWidget *parent) : BaseWindow(parent) { setWindowTitle(tr("Thread")); - setSortingEnabled(true); + treeView()->setSortingEnabled(true); setAlwaysAdjustColumnsAction(debuggerCore()->action(AlwaysAdjustThreadsColumnWidths)); setObjectName(QLatin1String("ThreadsWindow")); } diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 0350bb03e4..68955e2876 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -485,17 +485,17 @@ WatchWindow::WatchWindow(Type type, QWidget *parent) setObjectName(QLatin1String("WatchWindow")); m_grabbing = false; setWindowTitle(tr("Locals and Expressions")); - setIndentation(indentation() * 9/10); - setUniformRowHeights(true); - setItemDelegate(new WatchDelegate(this)); - setDragEnabled(true); - setAcceptDrops(true); - setDropIndicatorShown(true); + treeView()->setIndentation(treeView()->indentation() * 9/10); + treeView()->setUniformRowHeights(true); + treeView()->setItemDelegate(new WatchDelegate(this)); + treeView()->setDragEnabled(true); + treeView()->setAcceptDrops(true); + treeView()->setDropIndicatorShown(true); setAlwaysAdjustColumnsAction(debuggerCore()->action(AlwaysAdjustLocalsColumnWidths)); - connect(this, SIGNAL(expanded(QModelIndex)), + connect(treeView(), SIGNAL(expanded(QModelIndex)), SLOT(expandNode(QModelIndex))); - connect(this, SIGNAL(collapsed(QModelIndex)), + connect(treeView(), SIGNAL(collapsed(QModelIndex)), SLOT(collapseNode(QModelIndex))); } @@ -512,9 +512,10 @@ void WatchWindow::collapseNode(const QModelIndex &idx) void WatchWindow::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete && m_type == WatchersType) { - QModelIndexList indices = selectionModel()->selectedRows(); - if (indices.isEmpty() && selectionModel()->currentIndex().isValid()) - indices.append(selectionModel()->currentIndex()); + QItemSelectionModel *sm = treeView()->selectionModel(); + QModelIndexList indices = sm->selectedRows(); + if (indices.isEmpty() && sm->currentIndex().isValid()) + indices.append(sm->currentIndex()); QStringList exps; foreach (const QModelIndex &idx, indices) { QModelIndex idx1 = idx.sibling(idx.row(), 0); @@ -525,12 +526,12 @@ void WatchWindow::keyPressEvent(QKeyEvent *ev) } else if (ev->key() == Qt::Key_Return && ev->modifiers() == Qt::ControlModifier && m_type == LocalsType) { - QModelIndex idx = currentIndex(); + QModelIndex idx = treeView()->currentIndex(); QModelIndex idx1 = idx.sibling(idx.row(), 0); QString exp = model()->data(idx1).toString(); watchExpression(exp); } - QTreeView::keyPressEvent(ev); + BaseWindow::keyPressEvent(ev); } void WatchWindow::dragEnterEvent(QDragEnterEvent *ev) @@ -570,7 +571,7 @@ void WatchWindow::mouseDoubleClickEvent(QMouseEvent *ev) watchExpression(QString()); return; } - QTreeView::mouseDoubleClickEvent(ev); + BaseWindow::mouseDoubleClickEvent(ev); } // Text for add watch action with truncated expression. @@ -978,7 +979,7 @@ bool WatchWindow::event(QEvent *ev) releaseMouse(); currentEngine()->watchPoint(mapToGlobal(mev->pos())); } - return QTreeView::event(ev); + return BaseWindow::event(ev); } void WatchWindow::editItem(const QModelIndex &idx) @@ -989,7 +990,7 @@ void WatchWindow::editItem(const QModelIndex &idx) void WatchWindow::setModel(QAbstractItemModel *model) { BaseWindow::setModel(model); - setRootIsDecorated(true); + treeView()->setRootIsDecorated(true); if (header()) { header()->setDefaultAlignment(Qt::AlignLeft); if (m_type != LocalsType) @@ -1008,8 +1009,8 @@ void WatchWindow::resetHelper(const QModelIndex &idx) { if (idx.data(LocalsExpandedRole).toBool()) { //qDebug() << "EXPANDING " << model()->data(idx, INameRole); - if (!isExpanded(idx)) { - expand(idx); + if (!treeView()->isExpanded(idx)) { + treeView()->expand(idx); for (int i = 0, n = model()->rowCount(idx); i != n; ++i) { QModelIndex idx1 = model()->index(i, 0, idx); resetHelper(idx1); @@ -1017,8 +1018,8 @@ void WatchWindow::resetHelper(const QModelIndex &idx) } } else { //qDebug() << "COLLAPSING " << model()->data(idx, INameRole); - if (isExpanded(idx)) - collapse(idx); + if (treeView()->isExpanded(idx)) + treeView()->collapse(idx); } } |