Changeset 101095 in vbox
- Timestamp:
- Sep 12, 2023 10:55:48 PM (19 months ago)
- svn:sync-xref-src-repo-rev:
- 159064
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/VBoxDbgStatsQt.cpp
r99739 r101095 81 81 /** The node should be refreshed. */ 82 82 kDbgGuiStatsNodeState_kRefresh, 83 #if 0 /// @todo not implemented 83 84 /** diff: The node equals. */ 84 85 kDbgGuiStatsNodeState_kDiffEqual, … … 91 92 /** diff: The node is only in set 2. */ 92 93 kDbgGuiStatsNodeState_kDiffOnlyIn2, 94 #endif 93 95 /** The end of the valid state values. */ 94 96 kDbgGuiStatsNodeState_kEnd … … 1899 1901 if (m_fUpdateInsertRemove) 1900 1902 { 1901 /* emit layoutChanged(); - hrmpf, doesn't work reliably... */ 1902 beginResetModel(); 1903 #if 0 // hrmpf, layoutChanged() didn't work reliably at some point so doing this as well... 1904 beginResetModel(); 1903 1905 endResetModel(); 1906 #else 1907 emit layoutChanged(); 1908 #endif 1904 1909 } 1905 1910 else … … 1928 1933 Assert(Stack.iTop < (int32_t)RT_ELEMENTS(Stack.a)); 1929 1934 Stack.a[Stack.iTop].pNode = pNode->papChildren[iChild]; 1930 Stack.a[Stack.iTop].iChild = 0;1935 Stack.a[Stack.iTop].iChild = -1; 1931 1936 } 1932 1937 else … … 1945 1950 if (iChild >= pNode->cChildren) 1946 1951 break; 1947 QModelIndex TopLeft = createIndex(iChild, 0, pNode->papChildren[iChild]);1952 QModelIndex const TopLeft = createIndex(iChild, 2, pNode->papChildren[iChild]); 1948 1953 pNode->papChildren[iChild]->enmState = kDbgGuiStatsNodeState_kVisible; 1949 1954 1950 /* any subsequent nodes that also needs refreshing? */ 1951 if ( ++iChild < pNode->cChildren 1952 && pNode->papChildren[iChild]->enmState == kDbgGuiStatsNodeState_kRefresh) 1953 { 1954 do pNode->papChildren[iChild]->enmState = kDbgGuiStatsNodeState_kVisible; 1955 while ( ++iChild < pNode->cChildren 1956 && pNode->papChildren[iChild]->enmState == kDbgGuiStatsNodeState_kRefresh); 1957 QModelIndex BottomRight = createIndex(iChild - 1, DBGGUI_STATS_COLUMNS - 1, pNode->papChildren[iChild - 1]); 1958 1959 /* emit the refresh signal */ 1960 emit dataChanged(TopLeft, BottomRight); 1961 } 1962 else 1963 { 1964 /* emit the refresh signal */ 1965 emit dataChanged(TopLeft, TopLeft); 1966 } 1955 /* Any subsequent nodes that also needs refreshing? */ 1956 while ( iChild + 1 < pNode->cChildren 1957 && pNode->papChildren[iChild + 1]->enmState == kDbgGuiStatsNodeState_kRefresh) 1958 iChild++; 1959 1960 /* emit the refresh signal */ 1961 QModelIndex const BottomRight = createIndex(iChild, DBGGUI_STATS_COLUMNS - 2, pNode->papChildren[iChild]); 1962 emit dataChanged(TopLeft, BottomRight); 1963 iChild++; 1967 1964 } 1968 1965 } … … 2152 2149 { 2153 2150 PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent); 2154 if (!pParent) 2155 { 2156 if ( a_rParent.isValid() 2157 || iRow 2158 || (unsigned)iColumn < DBGGUI_STATS_COLUMNS) 2159 { 2160 Assert(!a_rParent.isValid()); 2161 Assert(!iRow); 2162 Assert((unsigned)iColumn < DBGGUI_STATS_COLUMNS); 2163 return QModelIndex(); 2164 } 2165 2166 /* root */ 2167 return createIndex(0, iColumn, m_pRoot); 2168 } 2169 if ((unsigned)iRow >= pParent->cChildren) 2170 { 2171 Log(("index: iRow=%d >= cChildren=%u (iColumn=%d)\n", iRow, (unsigned)pParent->cChildren, iColumn)); 2172 return QModelIndex(); /* bug? */ 2173 } 2174 if ((unsigned)iColumn >= DBGGUI_STATS_COLUMNS) 2175 { 2176 Log(("index: iColumn=%d (iRow=%d)\n", iColumn, iRow)); 2177 return QModelIndex(); /* bug? */ 2178 } 2179 PDBGGUISTATSNODE pChild = pParent->papChildren[iRow]; 2180 return createIndex(iRow, iColumn, pChild); 2151 if (pParent) 2152 { 2153 AssertMsgReturn((unsigned)iRow < pParent->cChildren, 2154 ("iRow=%d >= cChildren=%u (iColumn=%d)\n", iRow, (unsigned)pParent->cChildren, iColumn), 2155 QModelIndex()); 2156 AssertMsgReturn((unsigned)iColumn < DBGGUI_STATS_COLUMNS, ("iColumn=%d (iRow=%d)\n", iColumn, iRow), QModelIndex()); 2157 2158 PDBGGUISTATSNODE pChild = pParent->papChildren[iRow]; 2159 return createIndex(iRow, iColumn, pChild); 2160 } 2161 2162 /* root? */ 2163 AssertReturn(a_rParent.isValid(), QModelIndex()); 2164 AssertMsgReturn(iRow == 0 && (unsigned)iColumn < DBGGUI_STATS_COLUMNS, ("iRow=%d iColumn=%d", iRow, iColumn), QModelIndex()); 2165 return createIndex(0, iColumn, m_pRoot); 2181 2166 } 2182 2167 … … 2443 2428 { 2444 2429 unsigned iCol = a_rIndex.column(); 2445 if (iCol >= DBGGUI_STATS_COLUMNS)2446 return QVariant();2430 AssertMsgReturn(iCol < DBGGUI_STATS_COLUMNS, ("%d\n", iCol), QVariant()); 2431 Log4(("Model::data(%p(%d,%d), %d)\n", nodeFromIndex(a_rIndex), iCol, a_rIndex.row(), a_eRole)); 2447 2432 2448 2433 if (a_eRole == Qt::DisplayRole) 2449 2434 { 2450 2435 PDBGGUISTATSNODE pNode = nodeFromIndex(a_rIndex); 2451 if (!pNode) 2452 return QVariant(); 2436 AssertReturn(pNode, QVariant()); 2453 2437 2454 2438 switch (iCol)
Note:
See TracChangeset
for help on using the changeset viewer.