我尝试找到QtableWidget
标题单元格的列,如下所示
column = QtCore.QObject.findChild(mytableWidget, unicode("NAME")).column() # it should retruns 0
其中mytableWidget
是已定义的表
self.mytableWidget = QtGui.QTableWidget(self.frame)
...
...
item = QtGui.QTableWidgetItem("NAME")
self.mytableWidget.setHorizontalHeaderItem(0, item) # searching this item
但是我收到以下错误
TypeError: 'PySide.QtCore.QObject.findChild' called with wrong argument types:
PySide.QtCore.QObject.findChild(unicode)
Supported signatures:
PySide.QtCore.QObject.findChild(PyTypeObject, unicode = QString())