right clicking tree view doen't switch tab

This commit is contained in:
Braden Jennings 2024-03-11 10:30:42 +13:00 committed by Jakub Trllo
parent dd776b728b
commit b8f0d590f1
2 changed files with 11 additions and 6 deletions

View file

@ -581,7 +581,8 @@ class InstanceCardView(AbstractInstanceView):
)
def mouseDoubleClickEvent(self, event):
self.double_clicked.emit()
if event.button() == QtCore.Qt.LeftButton:
self.double_clicked.emit()
def sizeHint(self):
"""Modify sizeHint based on visibility of scroll bars."""

View file

@ -379,7 +379,7 @@ class InstanceTreeView(QtWidgets.QTreeView):
"double click" as 2x "single click".
"""
if event.button() != QtCore.Qt.LeftButton:
return
return False
pressed_group_index = None
pos_index = self.indexAt(event.pos())
@ -388,13 +388,17 @@ class InstanceTreeView(QtWidgets.QTreeView):
self._pressed_group_index = pressed_group_index
return True
def mousePressEvent(self, event):
self._mouse_press(event)
super(InstanceTreeView, self).mousePressEvent(event)
handled = self._mouse_press(event)
if handled:
super(InstanceTreeView, self).mousePressEvent(event)
def mouseDoubleClickEvent(self, event):
self._mouse_press(event)
super(InstanceTreeView, self).mouseDoubleClickEvent(event)
handled = self._mouse_press(event)
if handled:
super(InstanceTreeView, self).mouseDoubleClickEvent(event)
def _mouse_release(self, event, pressed_index):
if event.button() != QtCore.Qt.LeftButton: