按nam查找QTableWidget项的列/行

2024-04-25 22:55:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试找到QtableWidget的标题单元格的列,如下所示

column = QtCore.QObject.findChild(mytableWidget, unicode("NAME")).column() # it should retruns 0

其中mytableWidget是已经定义的表

^{pr2}$

但是我得到了以下错误

TypeError: 'PySide.QtCore.QObject.findChild' called with wrong argument types:
  PySide.QtCore.QObject.findChild(unicode)
Supported signatures:
  PySide.QtCore.QObject.findChild(PyTypeObject, unicode = QString())

Tags: name标题定义unicodeitcolumnpysideshould