VirtualBox

Changeset 12842 in vbox


Ignore:
Timestamp:
Oct 1, 2008 12:08:08 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37212
Message:

Debugger: show the root, don't expand everything.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/VBoxDbgStatsQt4.cpp

    r12841 r12842  
    19761976{
    19771977    PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent);
    1978     return pParent ? pParent->cChildren : 0;
     1978    return pParent ? pParent->cChildren : 1 /* root */;
    19791979}
    19801980
     
    19841984{
    19851985    PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent);
    1986     return pParent
    1987         && pParent->cChildren > 0;
     1986    return pParent ? pParent->cChildren > 0 : true /* root */;
    19881987}
    19891988
    19901989
    19911990QModelIndex
    1992 VBoxDbgStatsModel::index(int iRow, int iColumn, const QModelIndex &r_pParent) const
    1993 {
    1994     PDBGGUISTATSNODE pParent = nodeFromIndex(r_pParent);
     1991VBoxDbgStatsModel::index(int iRow, int iColumn, const QModelIndex &a_rParent) const
     1992{
     1993    PDBGGUISTATSNODE pParent = nodeFromIndex(a_rParent);
    19951994    if (!pParent)
    19961995    {
    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);
    19992001    }
    20002002    if ((unsigned)iRow >= pParent->cChildren)
     
    20242026    PDBGGUISTATSNODE pParent = pChild->pParent;
    20252027    if (!pParent)
    2026         return QModelIndex(); /* we're root */
     2028        return QModelIndex(); /* ultimate root */
    20272029
    20282030    return createIndex(pParent->iSelf, 0, pParent);
     
    27932795     */
    27942796    setModel(m_pModel);
    2795     setRootIndex(m_pModel->getRootIndex());
     2797    setRootIndex(QModelIndex());
    27962798    setRootIsDecorated(true);
    27972799    setItemsExpandable(true);
     
    34083410    pVLayout->addWidget(pHBox);
    34093411    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.
    34143417     */
    34153418    m_pView->expandAll();
    34163419    for (int i = 0; i <= 8; i++)
    34173420        m_pView->resizeColumnToContents(i);
     3421    m_pView->collapseAll();
     3422    m_pView->expandToDepth(0);
    34183423
    34193424    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette