diff options
author | hjk <hjk@theqtcompany.com> | 2015-04-22 12:37:39 +0200 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-04-22 12:08:37 +0000 |
commit | 89b0e4c069c9089b2adf367480212bcbd3948116 (patch) | |
tree | aeb884d4f9e726f58208666ed5e32cc8296c40e9 /src/plugins/debugger | |
parent | 9f269dfb635b02616eb10e97bf7c70e39b35e5a5 (diff) | |
download | qt-creator-89b0e4c069c9089b2adf367480212bcbd3948116.tar.gz |
TreeModel: API cleanup
- rename index{From->For}Item
- rename item{From->For}Index
- remove ununsed setColumnCount
Change-Id: I1cce9657e476dd1e8ffa9f7cdb2e646fab6884ab
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r-- | src/plugins/debugger/breakhandler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/debuggeroptionspage.cpp | 4 | ||||
-rw-r--r-- | src/plugins/debugger/debuggertooltipmanager.cpp | 4 | ||||
-rw-r--r-- | src/plugins/debugger/registerhandler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/watchhandler.cpp | 14 |
5 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index ee60ba1062..28d3ed71ac 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -534,7 +534,7 @@ void BreakHandler::updateMarkers() Breakpoint BreakHandler::findBreakpointByIndex(const QModelIndex &index) const { - TreeItem *item = itemFromIndex(index); + TreeItem *item = itemForIndex(index); return Breakpoint(item && item->parent() == rootItem() ? static_cast<BreakpointItem *>(item) : 0); } diff --git a/src/plugins/debugger/debuggeroptionspage.cpp b/src/plugins/debugger/debuggeroptionspage.cpp index 6d4f941721..32653c25c6 100644 --- a/src/plugins/debugger/debuggeroptionspage.cpp +++ b/src/plugins/debugger/debuggeroptionspage.cpp @@ -151,7 +151,7 @@ QModelIndex DebuggerItemModel::lastIndex() const { TreeItem *manualGroup = rootItem()->lastChild(); TreeItem *lastItem = manualGroup->lastChild(); - return lastItem ? indexFromItem(lastItem) : QModelIndex(); + return lastItem ? indexForItem(lastItem) : QModelIndex(); } DebuggerItem *DebuggerItemModel::currentDebugger() const @@ -183,7 +183,7 @@ void DebuggerItemModel::apply() void DebuggerItemModel::setCurrentIndex(const QModelIndex &index) { - TreeItem *treeItem = itemFromIndex(index); + TreeItem *treeItem = itemForIndex(index); m_currentTreeItem = treeItem && treeItem->level() == 2 ? static_cast<DebuggerTreeItem *>(treeItem) : 0; } diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index b3c64958a7..14ae377d04 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -264,7 +264,7 @@ public: { if (!idx.isValid()) return; - auto item = dynamic_cast<ToolTipWatchItem *>(itemFromIndex(idx)); + auto item = dynamic_cast<ToolTipWatchItem *>(itemForIndex(idx)); if (!item) return; QByteArray iname = item->iname; @@ -473,7 +473,7 @@ public: void reexpand(const QModelIndex &idx) { - TreeItem *item = model.itemFromIndex(idx); + TreeItem *item = model.itemForIndex(idx); QTC_ASSERT(item, return); QByteArray iname = item->data(0, LocalsINameRole).toByteArray(); bool shouldExpand = model.m_expandedINames.contains(iname); diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp index 545631c90f..da667a2e07 100644 --- a/src/plugins/debugger/registerhandler.cpp +++ b/src/plugins/debugger/registerhandler.cpp @@ -603,7 +603,7 @@ void RegisterHandler::setNumberFormat(const QByteArray &name, RegisterFormat for RegisterItem *reg = m_registerByName.value(name, 0); QTC_ASSERT(reg, return); reg->m_format = format; - QModelIndex index = indexFromItem(reg); + QModelIndex index = indexForItem(reg); emit dataChanged(index, index); } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index cc27ae30c1..59675a068f 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -904,9 +904,9 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const if (role == BaseTreeView::ExtraIndicesForColumnWidth) { QModelIndexList l; foreach (TreeItem *item, m_watchRoot->children()) - l.append(indexFromItem(item)); + l.append(indexForItem(item)); foreach (TreeItem *item, m_returnRoot->children()) - l.append(indexFromItem(item)); + l.append(indexForItem(item)); return QVariant::fromValue(l); } return WatchModelBase::data(idx, role); @@ -917,7 +917,7 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role if (!idx.isValid()) return false; // Triggered by ModelTester. - WatchItem *item = static_cast<WatchItem *>(itemFromIndex(idx)); + WatchItem *item = static_cast<WatchItem *>(itemForIndex(idx)); QTC_ASSERT(item, return false); switch (role) { @@ -1189,7 +1189,7 @@ void WatchModel::reinsertAllData() parent->insertChild(row, newItem); if (m_expandedINames.contains(parent->iname)) { emit inameIsExpanded(parent->iname); - emit itemIsExpanded(indexFromItem(parent)); + emit itemIsExpanded(indexForItem(parent)); } showEditValue(newItem); // FIXME: Needed? } @@ -1258,7 +1258,7 @@ void WatchModel::reexpandItems() { foreach (const QByteArray &iname, m_expandedINames) { if (WatchItem *item = findItem(iname)) { - emit itemIsExpanded(indexFromItem(item)); + emit itemIsExpanded(indexForItem(item)); emit inameIsExpanded(iname); } else { // Can happen. We might have stepped into another frame @@ -1534,7 +1534,7 @@ WatchModelBase *WatchHandler::model() const const WatchItem *WatchHandler::watchItem(const QModelIndex &idx) const { - return static_cast<WatchItem *>(m_model->itemFromIndex(idx)); + return static_cast<WatchItem *>(m_model->itemForIndex(idx)); } void WatchHandler::fetchMore(const QByteArray &iname) const @@ -1723,7 +1723,7 @@ void WatchHandler::resetLocation() void WatchHandler::setCurrentItem(const QByteArray &iname) { if (WatchItem *item = m_model->findItem(iname)) { - QModelIndex idx = m_model->indexFromItem(item); + QModelIndex idx = m_model->indexForItem(item); emit m_model->currentIndexRequested(idx); } } |