Changeset 64742 in vbox for trunk/src/VBox
- Timestamp:
- Nov 24, 2016 4:10:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp
r64491 r64742 24 24 # include <QMouseEvent> 25 25 # include <QPainter> 26 # include <QSortFilterProxyModel> 26 27 27 28 /* GUI includes: */ … … 244 245 // printf("Invalid index: %d\n", iIndex); 245 246 247 // Make sure model is alive: 248 AssertPtrReturn(tree()->model(), 0); 249 246 250 // Take into account we also have header with 'column count' indexes, 247 251 // so we should start enumerating tree indexes since 'column count'. … … 249 253 int iCurrentIndex = iColumnCount; 250 254 255 // Check whether we have proxy model set or usual one otherwise: 256 QSortFilterProxyModel *pProxyModel = qobject_cast<QSortFilterProxyModel*>(tree()->model()); 257 251 258 // Set iterator to root-index initially: 252 const QModelIndex root = tree()->rootIndex(); 259 const QModelIndex root = pProxyModel ? pProxyModel->mapToSource(tree()->rootIndex()) : 260 tree()->rootIndex(); 253 261 QModelIndex index = root; 254 262 … … 262 270 ++iCurrentIndex; 263 271 if (iCurrentIndex % iColumnCount == 0) 264 index = tree()->indexBelow(index); 272 { 273 index = pProxyModel ? pProxyModel->mapToSource(tree()->indexBelow(pProxyModel->mapFromSource(index))) : 274 tree()->indexBelow(index); 275 } 265 276 } 266 277
Note:
See TracChangeset
for help on using the changeset viewer.