Changeset 64774 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 1, 2016 3:34:45 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp
r64742 r64774 321 321 QModelIndex QITreeViewItem::modelIndex() const 322 322 { 323 /* Check whether we have proxy model set or source one otherwise: */ 324 QSortFilterProxyModel *pProxyModel = qobject_cast<QSortFilterProxyModel*>(parentTree()->model()); 325 326 /* Determine proxy and source root model-indexes, they can be equal: */ 327 const QModelIndex rootInProxy = parentTree()->rootIndex(); 328 const QModelIndex rootInSource = pProxyModel ? pProxyModel->mapToSource(rootInProxy) : rootInProxy; 329 323 330 /* Make sure it's not root model-index: */ 324 if ( parentTree()->rootIndex().internalPointer()325 && parentTree()->rootIndex().internalPointer() == this)326 return parentTree()->rootIndex();331 if ( rootInSource.internalPointer() 332 && rootInSource.internalPointer() == this) 333 return rootInProxy; 327 334 328 335 /* Determine our index inside parent: */ … … 350 357 351 358 /* Get parent model-index: */ 352 QModelIndex parentModelIndex = parentItem() ? parentItem()->modelIndex() : parentTree()->rootIndex();359 QModelIndex parentModelIndex = parentItem() ? parentItem()->modelIndex() : rootInProxy; 353 360 354 361 /* Return model-index as child of parent model-index: */
Note:
See TracChangeset
for help on using the changeset viewer.