VirtualBox

Changeset 103171 in vbox for trunk/src


Ignore:
Timestamp:
Feb 2, 2024 11:21:42 AM (14 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161428
Message:

FE/Qt: bugref:10501. Some fixes in the table sort functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.cpp

    r103166 r103171  
    12821282    if (pModel)
    12831283    {
     1284        /* Keep running vm always on top of the list: */
    12841285        bool fLeftRunning = pModel->isVMRunning(sourceLeftIndex.row());
    12851286        bool fRightRunning = pModel->isVMRunning(sourceRightIndex.row());
    1286         if (fLeftRunning && fRightRunning)
     1287        if (fLeftRunning && !fRightRunning)
    12871288        {
    12881289            if (sortOrder() == Qt::AscendingOrder)
     
    12981299                return true;
    12991300        }
    1300 
    13011301    }
    13021302    return QSortFilterProxyModel::lessThan(sourceLeftIndex, sourceRightIndex);
     
    14761476        }
    14771477        if (role == Qt::ForegroundRole)
    1478             return m_defaultViewFontColor.lighter(250);
     1478        {
     1479            /* For some reason QColor::lighter(..) is not working here: */
     1480            QColor color = qApp->palette().color(QPalette::Active, QPalette::WindowText);
     1481            int h, s, l;
     1482            color.getHsl(&h, &s, &l);
     1483            l = 100;
     1484            return QColor::fromHsl(h, s, l);
     1485        }
    14791486    }
    14801487    if (!index.isValid() || role != Qt::DisplayRole || index.row() >= rowCount())
     
    18621869        m_pProxyModel->setSourceModel(m_pModel);
    18631870        m_pProxyModel->setNotRunningVMVisibility(m_fShowNotRunningVMs);
     1871        m_pProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    18641872        m_pTableView->setModel(m_pProxyModel);
    18651873        m_pTableView->setItemDelegate(new UIVMActivityOverviewDelegate(this));
     
    18791887        /* Store the default font and its color of the table on the view. They are used in ::data(..): */
    18801888        m_pModel->setDefaultViewFont(m_pTableView->font());
    1881         m_pModel->setDefaultViewFontColor(m_pTableView->palette().color(QPalette::WindowText));
     1889        m_pModel->setDefaultViewFontColor(m_pTableView->palette().color(QPalette::Active, QPalette::WindowText));
    18821890
    18831891        connect(m_pModel, &UIActivityOverviewModel::sigDataUpdate,
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