(五 交互-2)PyQT5 Table click

double click 两者方法

Answer 1 - cellDoubleClicked

def fn_init_event(self):
    self.tblQuestUserInfo.cellDoubleClicked.connect(self.fn_query_quest_sys_info)


def fn_query_quest_sys_info(self, row, column):

    item = self.tblQuestUserInfo.item(row, column)
    quest_id = item.text()

Answer 2 - itemDoubleClicked

def fn_init_event(self):
    self.tblQuestUserInfo.itemDoubleClicked.connect(self.fn_query_quest_sys_info)

def fn_query_quest_sys_info(self, item):
    quest_id = item.text()

参考 document

(五 交互-2)PyQT5 Table click_第1张图片
image.png

QTableWidget Class Document

你可能感兴趣的:((五 交互-2)PyQT5 Table click)