|
@@ -780,6 +780,9 @@ class MainWindow(QMainWindow):
|
780
|
780
|
print('Mouse click: LEFT CLICK')
|
781
|
781
|
if event.buttons() == Qt.RightButton:
|
782
|
782
|
print('Mouse click: RIGHT CLICK')
|
|
783
|
+ # 修改 show_custom_context_menu 调用
|
|
784
|
+ if event.button() == Qt.RightButton:
|
|
785
|
+ self.show_custom_context_menu(event.position().toPoint())
|
783
|
786
|
|
784
|
787
|
# 设一个全局变量,存数据库中所有的包含内容(数据库-三种方法-表)
|
785
|
788
|
dblist = []
|
|
@@ -1107,7 +1110,7 @@ class MainWindow(QMainWindow):
|
1107
|
1110
|
def eventFilter(self, source, event):
|
1108
|
1111
|
if event.type() == QEvent.MouseButtonDblClick:
|
1109
|
1112
|
# 获取双击的单元格
|
1110
|
|
- index = self.ui.resultTableView1.indexAt(event.pos())
|
|
1113
|
+ index = self.ui.resultTableView1.indexAt(event.position().toPoint())
|
1111
|
1114
|
if index.isValid():
|
1112
|
1115
|
# 清空单元格内容
|
1113
|
1116
|
# self.ui.resultTableView1.setItem(index.row(), index.column(), QTableWidgetItem(""))
|