Changeset 12842 in vbox
- Timestamp:
- Oct 1, 2008 12:08:08 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 37212
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/VBoxDbgStatsQt4.cpp
r12841 r12842 1976 1976 { 1977 1977 PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent); 1978 return pParent ? pParent->cChildren : 0;1978 return pParent ? pParent->cChildren : 1 /* root */; 1979 1979 } 1980 1980 … … 1984 1984 { 1985 1985 PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent); 1986 return pParent 1987 && pParent->cChildren > 0; 1986 return pParent ? pParent->cChildren > 0 : true /* root */; 1988 1987 } 1989 1988 1990 1989 1991 1990 QModelIndex 1992 VBoxDbgStatsModel::index(int iRow, int iColumn, const QModelIndex & r_pParent) const1993 { 1994 PDBGGUISTATSNODE pParent = nodeFromIndex( r_pParent);1991 VBoxDbgStatsModel::index(int iRow, int iColumn, const QModelIndex &a_rParent) const 1992 { 1993 PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent); 1995 1994 if (!pParent) 1996 1995 { 1997 Log(("index: iRow=%d iColumn=%d invalid parent\n", iRow, iColumn)); 1998 return QModelIndex(); /* bug? */ 1996 /* root */ 1997 AssertReturn(!a_rParent.isValid(), QModelIndex()); 1998 AssertReturn(!iRow, QModelIndex()); 1999 AssertReturn((unsigned)iColumn < DBGGUI_STATS_COLUMNS, QModelIndex()); 2000 return createIndex(0, iColumn, m_pRoot); 1999 2001 } 2000 2002 if ((unsigned)iRow >= pParent->cChildren) … … 2024 2026 PDBGGUISTATSNODE pParent = pChild->pParent; 2025 2027 if (!pParent) 2026 return QModelIndex(); /* we're root */2028 return QModelIndex(); /* ultimate root */ 2027 2029 2028 2030 return createIndex(pParent->iSelf, 0, pParent); … … 2793 2795 */ 2794 2796 setModel(m_pModel); 2795 setRootIndex( m_pModel->getRootIndex());2797 setRootIndex(QModelIndex()); 2796 2798 setRootIsDecorated(true); 2797 2799 setItemsExpandable(true); … … 3408 3410 pVLayout->addWidget(pHBox); 3409 3411 pVLayout->addWidget(m_pView); 3410 this->setLayout(pVLayout); 3411 3412 /* 3413 * Expand all and resize columns... 3412 setLayout(pVLayout); 3413 3414 /* 3415 * Resize the columns. 3416 * Seems this has to be done with all nodes expanded. 3414 3417 */ 3415 3418 m_pView->expandAll(); 3416 3419 for (int i = 0; i <= 8; i++) 3417 3420 m_pView->resizeColumnToContents(i); 3421 m_pView->collapseAll(); 3422 m_pView->expandToDepth(0); 3418 3423 3419 3424 /*
Note:
See TracChangeset
for help on using the changeset viewer.