Changeset 104513 in vbox
- Timestamp:
- May 3, 2024 4:09:10 PM (7 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp
r103987 r104513 87 87 /** Returns corresponding QITreeViewItem. */ 88 88 QITreeViewItem *item() const { return qobject_cast<QITreeViewItem*>(object()); } 89 90 /** Returns item bounding rectangle including all the children. */ 91 QRect boundingRect() const; 89 92 }; 90 93 … … 199 202 200 203 /* Get the local rect: */ 201 const QRect itemRectInViewport = item()->rect();204 const QRect itemRectInViewport = boundingRect(); 202 205 const QSize itemSize = itemRectInViewport.size(); 203 206 const QPoint itemPosInViewport = itemRectInViewport.topLeft(); … … 235 238 /* Empty state by default: */ 236 239 return QAccessible::State(); 240 } 241 242 QRect QIAccessibilityInterfaceForQITreeViewItem::boundingRect() const 243 { 244 /* Calculate cumulative region: */ 245 QRegion region; 246 /* Append item rectangle itself: */ 247 region += item()->rect(); 248 /* Do the same for all the children: */ 249 for (int i = 0; i < childCount(); ++i) 250 { 251 QIAccessibilityInterfaceForQITreeViewItem *pChild = 252 dynamic_cast<QIAccessibilityInterfaceForQITreeViewItem*>(child(i)); 253 AssertPtrReturn(pChild, QRect()); 254 region += pChild->boundingRect(); 255 } 256 /* Return cumulative bounding rectangle: */ 257 return region.boundingRect(); 237 258 } 238 259 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.h
r103977 r104513 134 134 virtual QITreeViewItem *childItem(int /* iIndex */) const { return 0; } 135 135 136 /** Returns child rectangle. */137 QRect visualRect(const QModelIndex &index) const RT_OVERRIDE { return QTreeView::visualRect(index); }138 139 136 protected slots: 140 137
Note:
See TracChangeset
for help on using the changeset viewer.