0
我想在我的程序中使用QTableWidget。按下按鈕時,它應該讀取QTableWidget第一行上每列的值,並將其分配給稍後使用的變量。循環遍歷行QTableWidget
現在,它現在打印正確,但隨後它給了我一個屬性錯誤,並凍結計劃。
代碼:
def Loopthru(self):
for i in range(0, 5):
t = self.valveThicknessTable.item(0,i).text()### Returns error :AttributeError: 'NoneType' object has no attribute 'text'
print(t) ###test
我認爲它是與通過列試圖用循環變量i。任何想法,爲什麼它給了我這個錯誤?
測試程序代碼:
https://drive.google.com/drive/folders/0BzcHlfStubD3R0VBTWZDQXp1bWc?usp=sharing