Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp	(revision 64741)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp	(revision 64742)
@@ -24,4 +24,5 @@
 # include <QMouseEvent>
 # include <QPainter>
+# include <QSortFilterProxyModel>
 
 /* GUI includes: */
@@ -244,4 +245,7 @@
         // printf("Invalid index: %d\n", iIndex);
 
+        // Make sure model is alive:
+        AssertPtrReturn(tree()->model(), 0);
+
         // Take into account we also have header with 'column count' indexes,
         // so we should start enumerating tree indexes since 'column count'.
@@ -249,6 +253,10 @@
         int iCurrentIndex = iColumnCount;
 
+        // Check whether we have proxy model set or usual one otherwise:
+        QSortFilterProxyModel *pProxyModel = qobject_cast<QSortFilterProxyModel*>(tree()->model());
+
         // Set iterator to root-index initially:
-        const QModelIndex root = tree()->rootIndex();
+        const QModelIndex root = pProxyModel ? pProxyModel->mapToSource(tree()->rootIndex()) :
+                                 tree()->rootIndex();
         QModelIndex index = root;
 
@@ -262,5 +270,8 @@
             ++iCurrentIndex;
             if (iCurrentIndex % iColumnCount == 0)
-                index = tree()->indexBelow(index);
+            {
+                index = pProxyModel ? pProxyModel->mapToSource(tree()->indexBelow(pProxyModel->mapFromSource(index))) :
+                                      tree()->indexBelow(index);
+            }
         }
 
