我有下面的代码,我只想找到选择特定单元格而不是列或行的命令。
例如:
QTableWidget().item(2,0)
代码是:
def main():
app = QApplication(sys.argv)
table = QTableWidget()
tableItem = QTableWidgetItem()
# initiate table
table.setWindowTitle("QTableWidget Example @pythonspot.com")
table.resize(400, 250)
table.setRowCount(4)
table.setVerticalHeaderLabels(["Number 0ne","Number Two","Number Three","Number Four"])
table.setColumnCount(2)
table.setHorizontalHeaderLabels(['Name', 'Age'])
for x in range(4):
for y in range(2):
table.setItem(x, y, QTableWidgetItem("Item (%d , %d)"% ((x+1),(y+1))))
# show table
table.show()
app.exec_()
if __name__ == '__main__':
main()
我想知道什么是PyQt命令的最佳参考,这有助于编码人员了解命令的参数?
例如,在这个命令中,哪里是告知QString
可以是什么的最佳位置:setAccessibleName(self, QString)