- Timestamp:
- Mar 23, 2020 6:40:37 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136584
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/monitor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/monitor/UIMonitorCommon.cpp
r83347 r83375 47 47 void UIMonitorCommon::getDiskLoad(CMachineDebugger &debugger, quint64 &uOutDiskWritten, quint64 &uOutDiskRead) 48 48 { 49 uOutDiskWritten = 0; 50 uOutDiskRead = 0; 49 51 QVector<UIDebuggerMetricData> xmlData = getAndParseStatsFromDebugger(debugger, "/Public/Storage/*/Port*/Bytes*"); 50 52 foreach (const UIDebuggerMetricData &data, xmlData) … … 62 64 void UIMonitorCommon::getVMMExitCount(CMachineDebugger &debugger, quint64 &uOutVMMExitCount) 63 65 { 66 uOutVMMExitCount = 0; 64 67 QVector<UIDebuggerMetricData> xmlData = getAndParseStatsFromDebugger(debugger, "/PROF/CPU*/EM/RecordedExits"); 65 68 foreach (const UIDebuggerMetricData &data, xmlData) -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp
r83365 r83375 19 19 #include <QAbstractTableModel> 20 20 #include <QHeaderView> 21 #include <QItemDelegate> 21 22 #include <QMenuBar> 22 23 #include <QPushButton> … … 147 148 }; 148 149 150 151 /********************************************************************************************************************************* 152 * UIVMResouceMonitorDelegate definition. * 153 *********************************************************************************************************************************/ 154 /** A QItemDelegate child class to disable dashed lines drawn around selected cells in QTableViews */ 155 class UIVMResouceMonitorDelegate : public QItemDelegate 156 { 157 158 Q_OBJECT; 159 160 protected: 161 162 virtual void drawFocus ( QPainter * /*painter*/, const QStyleOptionViewItem & /*option*/, const QRect & /*rect*/ ) const {} 163 }; 164 149 165 /********************************************************************************************************************************* 150 166 * Class UIVMResouceMonitorItem implementation. * … … 373 389 m_itemList[i].m_uCPUGuestLoad = aPctExecuting; 374 390 m_itemList[i].m_uCPUVMMLoad = aPctVMM; 391 /* Network rate: */ 392 quint64 uPrevDownTotal = m_itemList[i].m_uNetworkDownTotal; 393 quint64 uPrevUpTotal = m_itemList[i].m_uNetworkUpTotal; 375 394 UIMonitorCommon::getNetworkLoad(m_itemList[i].m_comDebugger, 376 m_itemList[i].m_uNetworkDownRate, m_itemList[i].m_uNetworkUpRate); 377 m_itemList[i].m_uNetworkDownTotal += m_itemList[i].m_uNetworkDownRate; 378 m_itemList[i].m_uNetworkUpTotal += m_itemList[i].m_uNetworkUpRate; 379 395 m_itemList[i].m_uNetworkDownTotal, m_itemList[i].m_uNetworkUpTotal); 396 m_itemList[i].m_uNetworkDownRate = m_itemList[i].m_uNetworkDownTotal - uPrevDownTotal; 397 m_itemList[i].m_uNetworkUpRate = m_itemList[i].m_uNetworkUpTotal - uPrevUpTotal; 398 399 /* IO rate: */ 400 quint64 uPrevWriteTotal = m_itemList[i].m_uDiskWriteTotal; 401 quint64 uPrevReadTotal = m_itemList[i].m_uDiskReadTotal; 380 402 UIMonitorCommon::getDiskLoad(m_itemList[i].m_comDebugger, 381 m_itemList[i].m_uDiskWrite Rate, m_itemList[i].m_uDiskReadRate);382 m_itemList[i].m_uDiskWrite Total += m_itemList[i].m_uDiskWriteRate;383 m_itemList[i].m_uDiskRead Total += m_itemList[i].m_uDiskReadRate;403 m_itemList[i].m_uDiskWriteTotal, m_itemList[i].m_uDiskReadTotal); 404 m_itemList[i].m_uDiskWriteRate = m_itemList[i].m_uDiskWriteTotal - uPrevWriteTotal; 405 m_itemList[i].m_uDiskReadRate = m_itemList[i].m_uDiskReadTotal - uPrevReadTotal; 384 406 } 385 407 } 386 //emit layoutChanged();387 /* dataChanged signal result in view update when there is a proxy model in between. */388 //emit dataChanged(index(0,0), index(rowCount(), columnCount()));389 408 emit sigDataUpdate(); 390 409 } … … 402 421 , m_fShowToolbar(fShowToolbar) 403 422 , m_pToolBar(0) 404 , m_pTable Widget(0)423 , m_pTableView(0) 405 424 { 406 425 /* Prepare: */ … … 459 478 m_pProxyModel = new UIResourceMonitorProxyModel(this); 460 479 461 m_pTable Widget= new QTableView();462 if (m_pTable Widget&& m_pModel && m_pProxyModel)463 { 464 layout()->addWidget(m_pTable Widget);480 m_pTableView = new QTableView(); 481 if (m_pTableView && m_pModel && m_pProxyModel) 482 { 483 layout()->addWidget(m_pTableView); 465 484 m_pProxyModel->setSourceModel(m_pModel); 466 m_pTableWidget->setModel(m_pProxyModel); 467 m_pTableWidget->setSelectionMode(QAbstractItemView::NoSelection); 468 469 /* m_pTableWidget->setSelectionMode(QAbstractItemView::SingleSelection); 470 m_pTableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);*/ 471 m_pTableWidget->setShowGrid(false); 472 m_pTableWidget->horizontalHeader()->setHighlightSections(false); 473 m_pTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 474 m_pTableWidget->horizontalHeader()->setStretchLastSection(true); 475 476 m_pTableWidget->verticalHeader()->setVisible(false); 477 m_pTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); 485 m_pTableView->setModel(m_pProxyModel); 486 m_pTableView->setItemDelegate(new UIVMResouceMonitorDelegate); 487 m_pTableView->setSelectionMode(QAbstractItemView::NoSelection); 488 489 /* m_pTableView->setSelectionMode(QAbstractItemView::SingleSelection); 490 m_pTableView->setSelectionBehavior(QAbstractItemView::SelectRows);*/ 491 m_pTableView->setShowGrid(false); 492 m_pTableView->horizontalHeader()->setHighlightSections(false); 493 m_pTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 494 m_pTableView->horizontalHeader()->setStretchLastSection(true); 495 496 m_pTableView->verticalHeader()->setVisible(false); 497 m_pTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); 478 498 /* Minimize the row height: */ 479 m_pTable Widget->verticalHeader()->setDefaultSectionSize(m_pTableWidget->verticalHeader()->minimumSectionSize());480 m_pTable Widget->setAlternatingRowColors(true);481 m_pTable Widget->setSortingEnabled(true);482 m_pTable Widget->sortByColumn(0, Qt::AscendingOrder);499 m_pTableView->verticalHeader()->setDefaultSectionSize(m_pTableView->verticalHeader()->minimumSectionSize()); 500 m_pTableView->setAlternatingRowColors(true); 501 m_pTableView->setSortingEnabled(true); 502 m_pTableView->sortByColumn(0, Qt::AscendingOrder); 483 503 connect(m_pModel, &UIResourceMonitorModel::sigDataUpdate, this, &UIResourceMonitorWidget::sltHandleDataUpdate); 484 504 } -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.h
r83365 r83375 95 95 * @{ */ 96 96 UIToolBar *m_pToolBar; 97 QTableView *m_pTable Widget;97 QTableView *m_pTableView; 98 98 UIResourceMonitorProxyModel *m_pProxyModel; 99 99 UIResourceMonitorModel *m_pModel;
Note:
See TracChangeset
for help on using the changeset viewer.