10 from PyQt4.QtCore import * |
10 from PyQt4.QtCore import * |
11 from PyQt4.QtGui import * |
11 from PyQt4.QtGui import * |
12 |
12 |
13 import Preferences |
13 import Preferences |
14 |
14 |
|
15 |
15 class BrowserSortFilterProxyModel(QSortFilterProxyModel): |
16 class BrowserSortFilterProxyModel(QSortFilterProxyModel): |
16 """ |
17 """ |
17 Class implementing the browser sort filter proxy model. |
18 Class implementing the browser sort filter proxy model. |
18 """ |
19 """ |
19 def __init__(self, parent = None): |
20 def __init__(self, parent=None): |
20 """ |
21 """ |
21 Constructor |
22 Constructor |
22 |
23 |
23 @param parent reference to the parent object (QObject) |
24 @param parent reference to the parent object (QObject) |
24 """ |
25 """ |
67 return None |
68 return None |
68 |
69 |
69 sindex = self.mapToSource(index) |
70 sindex = self.mapToSource(index) |
70 return self.sourceModel().item(sindex) |
71 return self.sourceModel().item(sindex) |
71 |
72 |
72 def hasChildren(self, parent = QModelIndex()): |
73 def hasChildren(self, parent=QModelIndex()): |
73 """ |
74 """ |
74 Public method to check for the presence of child items. |
75 Public method to check for the presence of child items. |
75 |
76 |
76 We always return True for normal items in order to do lazy |
77 We always return True for normal items in order to do lazy |
77 population of the tree. |
78 population of the tree. |