mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
TB: When showing item at index, expand parent, not item
This commit is contained in:
parent
ccfff7f456
commit
f87375c45e
@ -571,9 +571,10 @@ class TagsView(QTreeView): # {{{
|
||||
def show_item_at_index(self, idx, box=False,
|
||||
position=QTreeView.PositionAtCenter):
|
||||
if idx.isValid() and idx.data(Qt.UserRole).toPyObject() is not self._model.root_item:
|
||||
self.setExpanded(idx, True) # Needed otherwise Qt segfaults if the
|
||||
self.expand(self._model.parent(idx)) # Needed otherwise Qt sometimes segfaults if the
|
||||
# node is buried in a collapsed, off
|
||||
# screen hierarchy
|
||||
self.setCurrentIndex(idx)
|
||||
self.scrollTo(idx, position)
|
||||
if box:
|
||||
self._model.set_boxed(idx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user