class MyWebView QWebView def __init__ self QWebView __init__ self def

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class MyWebView(QWebView):
def __init__(self):
QWebView.__init__(self)
def eventFilter(self, event):
if event.type() == QEvent.mousePressEvent:
return True
return False
def mousePressEvent(self, event):
if event.button() == Qt.RightButton:
print '1'
os.system('kdialog --msgbox RightButton')
event.accept()
else:
return QWebView.mousePressEvent(self, event)