mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-02 20:12:24 +12:00
Prevent right-click for popup menus to select item (fix #919)
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
a6ac2705d5
commit
6ea209e523
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
# --!-- coding: utf8 --!--
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import QTreeView, QHeaderView
|
||||
|
||||
from manuskript import settings
|
||||
|
@ -83,6 +84,12 @@ class outlineView(QTreeView, dndView, outlineBasics):
|
|||
dndView.dragMoveEvent(self, event)
|
||||
QTreeView.dragMoveEvent(self, event)
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
# Prevent selecting item while right-clicking for popup menu!
|
||||
if event.button() != Qt.RightButton:
|
||||
QTreeView.mousePressEvent(self, event)
|
||||
outlineBasics.mousePressEvent(self, event)
|
||||
|
||||
def mouseReleaseEvent(self, event):
|
||||
QTreeView.mouseReleaseEvent(self, event)
|
||||
outlineBasics.mouseReleaseEvent(self, event)
|
||||
|
|
|
@ -90,6 +90,12 @@ class treeView(QTreeView, dndView, outlineBasics):
|
|||
dndView.dragMoveEvent(self, event)
|
||||
QTreeView.dragMoveEvent(self, event)
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
# Prevent selecting item while right-clicking for popup menu!
|
||||
if event.button() != Qt.RightButton:
|
||||
QTreeView.mousePressEvent(self, event)
|
||||
outlineBasics.mousePressEvent(self, event)
|
||||
|
||||
def mouseReleaseEvent(self, event):
|
||||
QTreeView.mouseReleaseEvent(self, event)
|
||||
outlineBasics.mouseReleaseEvent(self, event)
|
||||
|
|
Loading…
Reference in a new issue