Changeset 85568 in vbox for trunk/src/VBox
- Timestamp:
- Jul 30, 2020 5:42:51 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.cpp
r85493 r85568 28 28 29 29 /* GUI includes: */ 30 #include "QIFileDialog.h" 30 31 #include "UICommon.h" 31 32 #include "UIPerformanceMonitor.h" … … 719 720 } 720 721 m_iMaximum = 0; 722 } 723 724 void UIMetric::toFile(QFile &file) const 725 { 726 QTextStream stream(&file); 727 stream << m_strName << "\n"; 728 foreach (const quint64& data, m_data[0]) 729 stream << data; 721 730 } 722 731 … … 978 987 } 979 988 989 void UIPerformanceMonitor::sltExportMetricsToFile() 990 { 991 QString strFileName = QIFileDialog::getSaveFileName("","",this, ""); 992 993 QFile data(strFileName); 994 if (data.open(QFile::WriteOnly | QFile::Truncate)) { 995 996 for (QMap<QString, UIMetric>::const_iterator iterator = m_metrics.begin(); 997 iterator != m_metrics.end(); ++iterator) 998 { 999 iterator.value().toFile(data); 1000 } 1001 data.close(); 1002 1003 // QTextStream out(&data); 1004 // out << "Result: " << qSetFieldWidth(10) << left << 3.14 << 2.7; 1005 // writes "Result: 3.14 2.7 " 1006 } 1007 1008 1009 } 1010 1011 980 1012 void UIPerformanceMonitor::sltGuestAdditionsStateChange() 981 1013 { … … 1056 1088 #endif 1057 1089 } 1090 // QAction *pAction = 1091 // actionPool()->action(UIActionIndex_M_Performance_S_Export); 1092 // if (pAction) 1093 // connect(pAction, &QAction::triggered, this, &UIPerformanceMonitor::sltExportMetricsToFile); 1058 1094 } 1059 1095 -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.h
r85485 r85568 26 26 #include <QMap> 27 27 #include <QQueue> 28 #include <QTextStream> 28 29 29 30 /* COM includes: */ … … 80 81 81 82 void reset(); 83 84 void toFile(QFile &file) const; 82 85 83 86 private: … … 137 140 /** Stop updating the charts if/when the machine state changes something other than KMachineState_Running. */ 138 141 void sltMachineStateChange(const QUuid &uId); 142 void sltExportMetricsToFile(); 139 143 140 144 private:
Note:
See TracChangeset
for help on using the changeset viewer.