VirtualBox

Changeset 83491 in vbox


Ignore:
Timestamp:
Mar 30, 2020 5:22:24 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136737
Message:

FE/Qt: bugref:9686. Update the dialog only when it is necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp

    r83490 r83491  
    198198    void setColumnVisible(const QMap<int, bool>& columnVisible);
    199199    bool columnVisible(int iColumnId) const;
     200    void setShouldUpdate(bool fShouldUpdate);
    200201
    201202private slots:
     
    224225    CPerformanceCollector m_performanceMonitor;
    225226    QMap<int, bool> m_columnVisible;
    226 
     227    /** If true the table data and corresponding view is updated. Possibly set by host widget to true only
     228      *  when the widget is visible in the main UI. */
     229    bool m_fShouldUpdate;
    227230};
    228231
     
    450453    :QAbstractTableModel(parent)
    451454    , m_pTimer(new QTimer(this))
     455    , m_fShouldUpdate(true)
    452456{
    453457    initializeItems();
     
    472476    Q_UNUSED(parent);
    473477    return VMResouceMonitorColumn_Max;
     478}
     479
     480void UIResourceMonitorModel::setShouldUpdate(bool fShouldUpdate)
     481{
     482    m_fShouldUpdate = fShouldUpdate;
    474483}
    475484
     
    588597void UIResourceMonitorModel::sltTimeout()
    589598{
     599    if (!m_fShouldUpdate)
     600        return;
    590601    ULONG aPctExecuting;
    591602    ULONG aPctHalted;
     
    787798{
    788799    m_fIsCurrentTool = fIsCurrentTool;
     800    if (m_pModel)
     801        m_pModel->setShouldUpdate(fIsCurrentTool);
    789802}
    790803
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