VirtualBox

Changeset 80451 in vbox


Ignore:
Timestamp:
Aug 27, 2019 6:49:29 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9510:

  • switching to vertical design
  • making VM Exit metric avaible in release builds as well
Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
Files:
2 edited

Legend:

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

    r80434 r80451  
    2323#include <QPainter>
    2424#include <QGridLayout>
     25#include <QScrollArea>
    2526#include <QStyle>
    2627#include <QXmlStreamReader>
     28#include <QVBoxLayout>
    2729#include <QTableWidget>
    2830#include <QTimer>
     
    431433    m_iPieChartRadius = 1.2f * qApp->style()->pixelMetric(QStyle::PM_LargeIconSize);
    432434    m_iPieChartSpacing = 0.3 * qApp->QApplication::style()->pixelMetric(QStyle::PM_LayoutTopMargin);
    433     m_size = QSize(10 * m_iPieChartRadius,  2 * m_iPieChartRadius);
     435    m_size = QSize(10 * m_iPieChartRadius,  3 * m_iPieChartRadius);
    434436    retranslateUi();
    435437}
     
    993995    /* Compute the maximum label string length and set it as a fixed width to labels to prevent always changing widths: */
    994996    /* Add m_iDecimalCount plus 3 characters for the number and 3 for unit string: */
    995     iMaximum += (iDecimalCount + 7);
     997    iMaximum += (iDecimalCount + 6);
    996998    if (!m_infoLabels.isEmpty())
    997999    {
     
    10101012void UIInformationRuntime::prepareObjects()
    10111013{
    1012     m_pMainLayout = new QGridLayout(this);
    1013     if (m_pMainLayout)
    1014     {
    1015         m_pMainLayout->setSpacing(10);
    1016     }
     1014    m_pMainLayout = new QVBoxLayout(this);
     1015    if (!m_pMainLayout)
     1016        return;
     1017    m_pMainLayout->setSpacing(0);
    10171018
    10181019    m_pTimer = new QTimer(this);
     
    10231024    }
    10241025
    1025     UIRuntimeInfoWidget *m_pRuntimeInfoWidget = new UIRuntimeInfoWidget(0, m_machine, m_console);
    1026     m_pMainLayout->addWidget(m_pRuntimeInfoWidget, 0, 0, 6, 1);
    1027     m_pRuntimeInfoWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
     1026    QScrollArea *pScrollArea = new QScrollArea;
     1027    m_pMainLayout->addWidget(pScrollArea);
     1028    QWidget *pContainerWidget = new QWidget;
     1029    QGridLayout *pContainerLayout = new QGridLayout;
     1030    pContainerWidget->setLayout(pContainerLayout);
     1031    pContainerLayout->setSpacing(10);
     1032    pContainerWidget->show();
     1033    pScrollArea->setWidget(pContainerWidget);
     1034    pScrollArea->setWidgetResizable(true);
    10281035
    10291036    QStringList chartOrder;
     
    10331040    foreach (const QString &strMetricName, chartOrder)
    10341041    {
     1042        QHBoxLayout *pChartLayout = new QHBoxLayout;
     1043        pChartLayout->setSpacing(0);
     1044
    10351045        if (!m_subMetrics.contains(strMetricName))
    10361046            continue;
    10371047        QLabel *pLabel = new QLabel;
    10381048        pLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
    1039         m_pMainLayout->addWidget(pLabel, iRow, 1);
     1049        pChartLayout->addWidget(pLabel);
    10401050        m_infoLabels.insert(strMetricName, pLabel);
    10411051
     
    10431053        m_charts.insert(strMetricName, pChart);
    10441054        pChart->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    1045         m_pMainLayout->addWidget(pChart, iRow, 2);
     1055        pChartLayout->addWidget(pChart);
     1056        pContainerLayout->addLayout(pChartLayout, iRow, 0, 1, 2);
    10461057        ++iRow;
    10471058    }
     
    10521063    if (m_charts.contains(m_strRAMMetricName) && m_charts[m_strRAMMetricName])
    10531064        m_charts[m_strRAMMetricName]->setWithPieChart(false);
     1065
     1066
     1067    UIRuntimeInfoWidget *m_pRuntimeInfoWidget = new UIRuntimeInfoWidget(0, m_machine, m_console);
     1068    pContainerLayout->addWidget(m_pRuntimeInfoWidget, iRow, 0, 2, 2);
     1069    m_pRuntimeInfoWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
     1070
    10541071
    10551072    QWidget *bottomSpacerWidget = new QWidget(this);
     
    10601077    // bottomSpacerWidget->setAutoFillBackground(true);
    10611078    // bottomSpacerWidget->setPalette(pal);
    1062 
    1063     m_pMainLayout->addWidget(bottomSpacerWidget, iRow, 1, 1, 2);
     1079    pContainerLayout->addWidget(bottomSpacerWidget, iRow, 0, 1, 2);
    10641080}
    10651081
     
    11571173                    else if (metric.name() == m_strVMExitMetricName)
    11581174                    {
    1159                         if (data.m_strName.contains("all", Qt::CaseInsensitive))
     1175                        if (data.m_strName.contains("RecordedExits", Qt::CaseInsensitive))
    11601176                            uTotalVMExits += data.m_counter;
    11611177                    }
     
    12381254    {
    12391255        UIMetric VMExitsMetric(m_strVMExitMetricName, "times", iMaximumQueueSize);
    1240         VMExitsMetric.setQueryPrefix("HM");
     1256        VMExitsMetric.setQueryPrefix("PROF");
    12411257        QStringList typeList;
    12421258        typeList << "CPU";
    12431259        VMExitsMetric.setDeviceTypeList(typeList);
    12441260        QStringList subStringList;
    1245         subStringList << "All";
     1261        subStringList << "RecordedExits";
    12461262        VMExitsMetric.setMetricDataSubString(subStringList);
    12471263        m_subMetrics.insert(m_strVMExitMetricName, VMExitsMetric);
     
    14841500
    14851501    QString strStats = debugger.GetStats(strQuery, false);
    1486 
    14871502    QXmlStreamReader xmlReader;
    14881503    xmlReader.addData(strStats);
     
    15001515                xmlData.push_back(DebuggerMetricData(*(attributes.value("name").string()), iCounter));
    15011516            }
     1517            else if (xmlReader.name() == "U64")
     1518            {
     1519                QXmlStreamAttributes attributes = xmlReader.attributes();
     1520                qulonglong iCounter = attributes.value("val").toULongLong();
     1521                iTotal += iCounter;
     1522                xmlReader.skipCurrentElement();
     1523                xmlData.push_back(DebuggerMetricData(*(attributes.value("name").string()), iCounter));
     1524            }
    15021525            else
    15031526                xmlReader.skipCurrentElement();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h

    r80420 r80451  
    4242/* Forward declarations: */
    4343class QTimer;
    44 class QGridLayout;
     44class QVBoxLayout;
    4545class QLabel;
    4646class UIChart;
     
    103103    void composeQueryString();
    104104
    105     /** This list is used to differentiate xml data we get from the IMachineDebugger. */
    106     QStringList m_deviceTypeList;
    107     /** This is used to select data series of the metric. For example, for network metric
    108       * it is ReceiveBytes/TransmitBytes */
    109     QStringList m_metricDataSubString;
    110     QString m_strQueryPrefix;
     105    /** @name The following strings are string list are used while making IMachineDebugger::getStats calls and parsing the resultin
     106      * xml stream.
     107      * @{ */
     108        /** This string is used while calling IMachineDebugger::getStats(..). It is composed of
     109        * m_strQueryPrefix, m_deviceTypeList, and  m_metricDataSubString. */
     110        QString m_strQueryString;
     111        /** This list is used to differentiate xml data we get from the IMachineDebugger. */
     112        QStringList m_deviceTypeList;
     113        /** This is used to select data series of the metric. For example, for network metric
     114         * it is ReceiveBytes/TransmitBytes */
     115        QStringList m_metricDataSubString;
     116        QString m_strQueryPrefix;
     117    /** @} */
    111118
    112119    QString m_strName;
    113120    QString m_strUnit;
    114     /** This string is used while calling IMachineDebugger::getStats(..). It is composed of
    115       * m_strQueryPrefix, m_deviceTypeList, and  m_metricDataSubString. */
    116     QString m_strQueryString;
    117121    qulonglong m_iMaximum;
    118122    QQueue<qulonglong> m_data[DATA_SERIES_SIZE];
     
    177181    CMachineDebugger      m_machineDebugger;
    178182    /** Holds the instance of layout we create. */
    179     QGridLayout *m_pMainLayout;
     183    QVBoxLayout *m_pMainLayout;
    180184    UIRuntimeInfoWidget *m_pRuntimeInfoWidget;
    181185    QTimer *m_pTimer;
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