55 @param sourceParent index of the source item (QModelIndex) |
55 @param sourceParent index of the source item (QModelIndex) |
56 @return flag indicating acceptance (boolean) |
56 @return flag indicating acceptance (boolean) |
57 """ |
57 """ |
58 return sourceColumn == 0 |
58 return sourceColumn == 0 |
59 |
59 |
60 def hasChildren(self, parent=QModelIndex()): |
60 def hasChildren(self, parent=None): |
61 """ |
61 """ |
62 Public method to check, if a parent node has some children. |
62 Public method to check, if a parent node has some children. |
63 |
63 |
64 @param parent index of the parent node (QModelIndex) |
64 @param parent index of the parent node (QModelIndex) |
65 @return flag indicating the presence of children (boolean) |
65 @return flag indicating the presence of children (boolean) |
66 """ |
66 """ |
|
67 if parent is None: |
|
68 parent = QModelIndex() |
67 sindex = self.mapToSource(parent) |
69 sindex = self.mapToSource(parent) |
68 return self.sourceModel().hasChildren(sindex) |
70 return self.sourceModel().hasChildren(sindex) |
69 |
71 |
70 |
72 |
71 class AddBookmarkDialog(QDialog, Ui_AddBookmarkDialog): |
73 class AddBookmarkDialog(QDialog, Ui_AddBookmarkDialog): |