Changeset 105541 in vbox
- Timestamp:
- Jul 30, 2024 11:55:10 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp
r105540 r105541 363 363 QRect QITreeViewItem::rect() const 364 364 { 365 /* Redirect call to parent-tree: */ 366 return parentTree() ? parentTree()->visualRect(modelIndex()) : QRect(); 365 /* We can only ask the parent-tree for a rectangle: */ 366 if (parentTree()) 367 { 368 /* Acquire parent-tree model: */ 369 const QAbstractItemModel *pModel = parentTree()->model(); 370 AssertPtrReturn(pModel, QRect()); 371 372 /* Acquire zero-column rectangle: */ 373 QModelIndex itemIndex = modelIndex(); 374 QRect rect = parentTree()->visualRect(itemIndex); 375 /* Enumerate all the remaining columns: */ 376 for (int i = 1; i < pModel->columnCount(); ++i) 377 { 378 /* Acquire enumerated column rectangle: */ 379 QModelIndex itemIndexI = pModel->index(itemIndex.row(), i, itemIndex.parent()); 380 QRegion cumulativeRegion(rect); 381 cumulativeRegion += parentTree()->visualRect(itemIndexI); 382 rect = cumulativeRegion.boundingRect(); 383 } 384 /* Total rect finally: */ 385 return rect; 386 } 387 /* Empty rect by default: */ 388 return QRect(); 367 389 } 368 390
Note:
See TracChangeset
for help on using the changeset viewer.