- Timestamp:
- May 6, 2024 1:19:22 PM (12 months ago)
- svn:sync-xref-src-repo-rev:
- 163042
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r104505 r104518 104 104 void updateInfoRow(InfoRow enmLine, const QString &strColumn0, const QString &strColumn1); 105 105 QString screenResolution(int iScreenId); 106 /** Creates to Q TableWidgetItems of the @enmInfoRow using the @p strLabel and @p strInfo and inserts it106 /** Creates to QITableWidgetItems of the @enmInfoRow using the @p strLabel and @p strInfo and inserts it 107 107 * to the row @p iRow. If @p iRow is -1 then the items inserted to the end of the table. */ 108 108 void insertInfoRow(InfoRow enmInfoRow, const QString& strLabel, const QString &strInfo, int iRow = -1); … … 238 238 iNewRow = iRow; 239 239 insertRow(iNewRow); 240 setItem(iNewRow, 1, new QTableWidgetItem(strLabel, enmInfoRow)); 241 setItem(iNewRow, 2, new QTableWidgetItem(strInfo, enmInfoRow)); 240 241 QITableWidgetItem *pItem1 = new QITableWidgetItem(strLabel); 242 AssertPtrReturnVoid(pItem1); 243 pItem1->setData(Qt::UserRole + 1, enmInfoRow); 244 setItem(iNewRow, 1, pItem1); 245 246 QITableWidgetItem *pItem2 = new QITableWidgetItem(strInfo); 247 AssertPtrReturnVoid(pItem2); 248 pItem2->setData(Qt::UserRole + 1, enmInfoRow); 249 setItem(iNewRow, 2, pItem2); 250 242 251 int iMargin = 0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin); 243 252 setRowHeight(iNewRow, 2 * iMargin + m_iFontHeight); … … 293 302 for (int i = iRowCount - 1; i >= 0; --i) 294 303 { 295 Q TableWidgetItem *pItem = item(i, 1);304 QITableWidgetItem *pItem = static_cast<QITableWidgetItem*>(item(i, 1)); 296 305 if (pItem && pItem->type() == InfoRow_Resolution) 297 306 removeRow(i); … … 332 341 { 333 342 /* Add the title row always as 0th row: */ 334 QTableWidgetItem *pTitleIcon = new QTableWidgetItem(UIIconPool::iconSet(":/state_running_16px.png"), "", InfoRow_Title); 335 QTableWidgetItem *pTitleItem = new QTableWidgetItem(m_strTableTitle, InfoRow_Title); 343 QITableWidgetItem *pTitleIcon = new QITableWidgetItem(""); 344 AssertReturnVoid(pTitleIcon); 345 pTitleIcon->setIcon(UIIconPool::iconSet(":/state_running_16px.png")); 346 pTitleIcon->setData(Qt::UserRole + 1, InfoRow_Title); 347 348 QITableWidgetItem *pTitleItem = new QITableWidgetItem(m_strTableTitle); 349 AssertReturnVoid(pTitleItem); 350 pTitleItem->setData(Qt::UserRole + 1, InfoRow_Title); 351 336 352 QFont titleFont(font()); 337 353 titleFont.setBold(true); … … 461 477 { 462 478 /* Skip the first column as it contains only icon and no text: */ 463 QTableWidgetItem *pItem = item(i, 1); 479 QITableWidgetItem *pItem = static_cast<QITableWidgetItem*>(item(i, 1)); 480 if (!pItem) 481 continue; 464 482 QString strColumn1 = pItem ? pItem->text() : QString(); 465 pItem = item(i, 2); 483 pItem = static_cast<QITableWidgetItem*>(item(i, 2)); 484 if (!pItem) 485 continue; 466 486 QString strColumn2 = pItem ? pItem->text() : QString(); 467 487 if (strColumn2.isEmpty()) … … 476 496 void UIRuntimeInfoWidget::updateInfoRow(InfoRow enmLine, const QString &strColumn0, const QString &strColumn1) 477 497 { 478 Q TableWidgetItem *pItem = 0;498 QITableWidgetItem *pItem = 0; 479 499 for (int i = 0; i < rowCount() && !pItem; ++i) 480 500 { 481 pItem = item(i, 2);501 pItem = static_cast<QITableWidgetItem*>(item(i, 2)); 482 502 if (!pItem) 483 503 continue;
Note:
See TracChangeset
for help on using the changeset viewer.