VirtualBox

Changeset 81097 in vbox


Ignore:
Timestamp:
Oct 2, 2019 12:45:04 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133708
Message:

FE/Qt: bugref:9510. Some corrections

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationPerformanceMonitor.cpp

    r80999 r81097  
    1818/* Qt includes: */
    1919#include <QApplication>
    20 #include <QHeaderView>
    2120#include <QLabel>
    2221#include <QMenu>
     
    2625#include <QStyle>
    2726#include <QXmlStreamReader>
    28 #include <QVBoxLayout>
    29 #include <QTableWidget>
    3027#include <QTimer>
    3128
    3229/* GUI includes: */
    3330#include "UICommon.h"
    34 #include "UIConverter.h"
    35 #include "UIExtraDataManager.h"
    36 #include "UIIconPool.h"
    3731#include "UIInformationPerformanceMonitor.h"
    3832#include "UISession.h"
     
    4236#include "CPerformanceCollector.h"
    4337#include "CPerformanceMetric.h"
    44 #include "CVRDEServerInfo.h"
    4538
    4639/* External includes: */
     
    10721065    quint64 uTotalVMExits = 0;
    10731066
    1074     QVector<DebuggerMetricData> xmlData = getTotalCounterFromDegugger(m_strQueryString);
     1067    QVector<UIDebuggerMetricData> xmlData = getTotalCounterFromDegugger(m_strQueryString);
    10751068    for (QMap<QString, UIMetric>::iterator iterator =  m_subMetrics.begin();
    10761069         iterator != m_subMetrics.end(); ++iterator)
     
    10801073        foreach (const QString &strDeviceType, deviceTypeList)
    10811074        {
    1082             foreach (const DebuggerMetricData &data, xmlData)
     1075            foreach (const UIDebuggerMetricData &data, xmlData)
    10831076            {
    10841077                if (data.m_strName.contains(strDeviceType, Qt::CaseInsensitive))
     
    14121405}
    14131406
    1414 QVector<DebuggerMetricData> UIInformationPerformanceMonitor::getTotalCounterFromDegugger(const QString &strQuery)
    1415 {
    1416     QVector<DebuggerMetricData> xmlData;
     1407QVector<UIDebuggerMetricData> UIInformationPerformanceMonitor::getTotalCounterFromDegugger(const QString &strQuery)
     1408{
     1409    QVector<UIDebuggerMetricData> xmlData;
    14171410    if (strQuery.isEmpty())
    14181411        return xmlData;
     
    14321425                iTotal += iCounter;
    14331426                xmlReader.skipCurrentElement();
    1434                 xmlData.push_back(DebuggerMetricData(*(attributes.value("name").string()), iCounter));
     1427                xmlData.push_back(UIDebuggerMetricData(*(attributes.value("name").string()), iCounter));
    14351428            }
    14361429            else if (xmlReader.name() == "U64")
     
    14401433                iTotal += iCounter;
    14411434                xmlReader.skipCurrentElement();
    1442                 xmlData.push_back(DebuggerMetricData(*(attributes.value("name").string()), iCounter));
     1435                xmlData.push_back(UIDebuggerMetricData(*(attributes.value("name").string()), iCounter));
    14431436            }
    14441437            else
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationPerformanceMonitor.h

    r80999 r81097  
    2727#include <QQueue>
    2828
    29 
    3029/* COM includes: */
    3130#include "COMEnums.h"
     
    3837/* GUI includes: */
    3938#include "QIWithRetranslateUI.h"
    40 #include "UIMainEventListener.h"
    41 
    4239
    4340/* Forward declarations: */
     
    5148#define DATA_SERIES_SIZE 2
    5249
    53 struct DebuggerMetricData
     50/** UIDebuggerMetricData is used as data storage while parsing the xml stream received from IMachineDebugger. */
     51struct UIDebuggerMetricData
    5452{
    55     DebuggerMetricData()
     53    UIDebuggerMetricData()
    5654        : m_counter(0){}
    57     DebuggerMetricData(const QString & strName, quint64 counter)
     55    UIDebuggerMetricData(const QString & strName, quint64 counter)
    5856        :m_strName(strName)
    5957        , m_counter(counter){}
     
    6260};
    6361
     62/** UIMetric represents a performance metric and is used to store data related to the corresponding metric. */
    6463class UIMetric
    6564{
     65
    6666public:
    6767
     
    134134/** UIInformationPerformanceMonitor class displays some high level performance metric of the guest system.
    135135  * The values are read in certain periods and cached in the GUI side. Currently we draw some line charts
    136   * and pie charts (where applicable) alongside with some text. Additionally it displays a table including some
    137   * run time attributes. */
     136  * and pie charts (where applicable) alongside with some text. IPerformanceCollector and IMachineDebugger are
     137  * two sources of the performance metrics. Unfortunately these two have very distinct APIs resulting a bit too much
     138  * special casing etc.*/
    138139class UIInformationPerformanceMonitor : public QIWithRetranslateUI<QWidget>
    139140{
     
    149150
    150151protected:
     152
    151153    void retranslateUi();
    152154
    153155private slots:
     156
    154157    /** Reads the metric values for several sources and calls corresponding update functions. */
    155158    void sltTimeout();
     
    172175    /** Returns a QColor for the chart with @p strChartName and data series with @p iDataIndex. */
    173176    QString dataColorString(const QString &strChartName, int iDataIndex);
    174     /** Parses the xml string we get from the IMachineDebugger and returns an array of DebuggerMetricData. */
    175     QVector<DebuggerMetricData> getTotalCounterFromDegugger(const QString &strQuery);
     177    /** Parses the xml string we get from the IMachineDebugger and returns an array of UIDebuggerMetricData. */
     178    QVector<UIDebuggerMetricData> getTotalCounterFromDegugger(const QString &strQuery);
    176179
    177180    bool m_fGuestAdditionsAvailable;
     
    191194    QMap<QString, UIMetric> m_subMetrics;
    192195    QMap<QString,UIChart*>  m_charts;
    193     QMap<QString,QLabel*>  m_infoLabels;
    194     ComObjPtr<UIMainEventListenerImpl> m_pQtGuestListener;
     196    /** Stores the QLabel instances which we show next to each UIChart. The value is the name of the metric. */
     197    QMap<QString,QLabel*>   m_infoLabels;
     198
    195199
    196200    /** @name These metric names are used for map keys to identify metrics.
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r81094 r81097  
    2626#include "UICommon.h"
    2727#include "UIConverter.h"
    28 #include "UIExtraDataManager.h"
    2928#include "UIIconPool.h"
    3029#include "UIInformationRuntime.h"
     
    3433#include "CGuest.h"
    3534#include "CVRDEServerInfo.h"
    36 
    3735
    3836enum InfoRow
     
    486484}
    487485
    488 UIInformationRuntime::~UIInformationRuntime()
    489 {
    490 }
    491 
    492486void UIInformationRuntime::retranslateUi()
    493487{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h

    r81000 r81097  
    3333/* GUI includes: */
    3434#include "QIWithRetranslateUI.h"
    35 #include "UIMainEventListener.h"
    36 
    3735
    3836/* Forward declarations: */
    3937class QVBoxLayout;
    40 class QLabel;
    41 class UIChart;
    4238class UISession;
    4339class UIRuntimeInfoWidget;
     
    5551      * @param console is machine console reference. */
    5652    UIInformationRuntime(QWidget *pParent, const CMachine &machine, const CConsole &console, const UISession *pSession);
    57     ~UIInformationRuntime();
    5853
    5954protected:
     55
    6056    void retranslateUi();
    6157
    6258private slots:
    6359
    64     /** @name These functions are connected to API events and implement necessary updates.
     60    /** @name These functions are connected to API events and implement necessary updates on the table.
    6561      * @{ */
    6662        void sltGuestAdditionsStateChange();
     
    8278    QVBoxLayout *m_pMainLayout;
    8379    UIRuntimeInfoWidget *m_pRuntimeInfoWidget;
    84 
    85     QMap<QString,QLabel*>  m_infoLabels;
    86     ComObjPtr<UIMainEventListenerImpl> m_pQtGuestListener;
    8780};
    8881
Note: See TracChangeset for help on using the changeset viewer.

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