Changeset 80451 in vbox
- Timestamp:
- Aug 27, 2019 6:49:29 PM (5 years ago)
- 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 23 23 #include <QPainter> 24 24 #include <QGridLayout> 25 #include <QScrollArea> 25 26 #include <QStyle> 26 27 #include <QXmlStreamReader> 28 #include <QVBoxLayout> 27 29 #include <QTableWidget> 28 30 #include <QTimer> … … 431 433 m_iPieChartRadius = 1.2f * qApp->style()->pixelMetric(QStyle::PM_LargeIconSize); 432 434 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); 434 436 retranslateUi(); 435 437 } … … 993 995 /* Compute the maximum label string length and set it as a fixed width to labels to prevent always changing widths: */ 994 996 /* Add m_iDecimalCount plus 3 characters for the number and 3 for unit string: */ 995 iMaximum += (iDecimalCount + 7);997 iMaximum += (iDecimalCount + 6); 996 998 if (!m_infoLabels.isEmpty()) 997 999 { … … 1010 1012 void UIInformationRuntime::prepareObjects() 1011 1013 { 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); 1017 1018 1018 1019 m_pTimer = new QTimer(this); … … 1023 1024 } 1024 1025 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); 1028 1035 1029 1036 QStringList chartOrder; … … 1033 1040 foreach (const QString &strMetricName, chartOrder) 1034 1041 { 1042 QHBoxLayout *pChartLayout = new QHBoxLayout; 1043 pChartLayout->setSpacing(0); 1044 1035 1045 if (!m_subMetrics.contains(strMetricName)) 1036 1046 continue; 1037 1047 QLabel *pLabel = new QLabel; 1038 1048 pLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop); 1039 m_pMainLayout->addWidget(pLabel, iRow, 1);1049 pChartLayout->addWidget(pLabel); 1040 1050 m_infoLabels.insert(strMetricName, pLabel); 1041 1051 … … 1043 1053 m_charts.insert(strMetricName, pChart); 1044 1054 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); 1046 1057 ++iRow; 1047 1058 } … … 1052 1063 if (m_charts.contains(m_strRAMMetricName) && m_charts[m_strRAMMetricName]) 1053 1064 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 1054 1071 1055 1072 QWidget *bottomSpacerWidget = new QWidget(this); … … 1060 1077 // bottomSpacerWidget->setAutoFillBackground(true); 1061 1078 // bottomSpacerWidget->setPalette(pal); 1062 1063 m_pMainLayout->addWidget(bottomSpacerWidget, iRow, 1, 1, 2); 1079 pContainerLayout->addWidget(bottomSpacerWidget, iRow, 0, 1, 2); 1064 1080 } 1065 1081 … … 1157 1173 else if (metric.name() == m_strVMExitMetricName) 1158 1174 { 1159 if (data.m_strName.contains(" all", Qt::CaseInsensitive))1175 if (data.m_strName.contains("RecordedExits", Qt::CaseInsensitive)) 1160 1176 uTotalVMExits += data.m_counter; 1161 1177 } … … 1238 1254 { 1239 1255 UIMetric VMExitsMetric(m_strVMExitMetricName, "times", iMaximumQueueSize); 1240 VMExitsMetric.setQueryPrefix(" HM");1256 VMExitsMetric.setQueryPrefix("PROF"); 1241 1257 QStringList typeList; 1242 1258 typeList << "CPU"; 1243 1259 VMExitsMetric.setDeviceTypeList(typeList); 1244 1260 QStringList subStringList; 1245 subStringList << " All";1261 subStringList << "RecordedExits"; 1246 1262 VMExitsMetric.setMetricDataSubString(subStringList); 1247 1263 m_subMetrics.insert(m_strVMExitMetricName, VMExitsMetric); … … 1484 1500 1485 1501 QString strStats = debugger.GetStats(strQuery, false); 1486 1487 1502 QXmlStreamReader xmlReader; 1488 1503 xmlReader.addData(strStats); … … 1500 1515 xmlData.push_back(DebuggerMetricData(*(attributes.value("name").string()), iCounter)); 1501 1516 } 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 } 1502 1525 else 1503 1526 xmlReader.skipCurrentElement(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h
r80420 r80451 42 42 /* Forward declarations: */ 43 43 class QTimer; 44 class Q GridLayout;44 class QVBoxLayout; 45 45 class QLabel; 46 46 class UIChart; … … 103 103 void composeQueryString(); 104 104 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 /** @} */ 111 118 112 119 QString m_strName; 113 120 QString m_strUnit; 114 /** This string is used while calling IMachineDebugger::getStats(..). It is composed of115 * m_strQueryPrefix, m_deviceTypeList, and m_metricDataSubString. */116 QString m_strQueryString;117 121 qulonglong m_iMaximum; 118 122 QQueue<qulonglong> m_data[DATA_SERIES_SIZE]; … … 177 181 CMachineDebugger m_machineDebugger; 178 182 /** Holds the instance of layout we create. */ 179 Q GridLayout *m_pMainLayout;183 QVBoxLayout *m_pMainLayout; 180 184 UIRuntimeInfoWidget *m_pRuntimeInfoWidget; 181 185 QTimer *m_pTimer;
Note:
See TracChangeset
for help on using the changeset viewer.