fix: AttributeError: 'QMouseEvent' object has no attribute 'pos' (#1598)
* fix: AttributeError: 'QMouseEvent' object has no attribute 'pos' ``` Caught exception: Traceback (most recent call last): File "D:\Python\Python39\lib\site-packages\aqt\browser\sidebar\tree.py", line 328, in mouseReleaseEvent if (index := self.currentIndex()) == self.indexAt(event.pos()): d ``` * fix: AttributeError: 'QMouseEvent' object has no attribute 'pos'
This commit is contained in:
parent
7af4d30c56
commit
90da6a8885
@ -325,7 +325,11 @@ class SidebarTreeView(QTreeView):
|
||||
self.tool == SidebarTool.SEARCH
|
||||
and event.button() == Qt.MouseButton.LeftButton
|
||||
):
|
||||
if (index := self.currentIndex()) == self.indexAt(event.pos()):
|
||||
if qtmajor == 5:
|
||||
pos = event.pos() # type: ignore
|
||||
else:
|
||||
pos = event.position().toPoint()
|
||||
if (index := self.currentIndex()) == self.indexAt(pos):
|
||||
self._on_search(index)
|
||||
|
||||
def keyPressEvent(self, event: QKeyEvent) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user