gerocampo
4th August 2010, 10:16
Good morning
I have a problem with population of a qtablewidget using custom widgets stored in a list.
the code for create the widgets is:
xdate=[None]*3200
n_projects=100
for i in range(0,n_projects):
label="Hello"
xdate[i]=QtGui.QLabel()
xdate[i].setText(label)
self.ui.TW1.setCellWidget(13,i,xdate[i])
Then I could see the custom widgets without problem. Then in the program I want to change the text of the qlabels and reinserting using the following code:
for i in range(0,n_projects):
xdate[i].setText("Option"+str(i))
self.ui.TW1.setCellWidget(13,i,xdate[i])
and now the widgets doesn't appear in the table.
Why is happen this?
Many thanks for your help
German
I have a problem with population of a qtablewidget using custom widgets stored in a list.
the code for create the widgets is:
xdate=[None]*3200
n_projects=100
for i in range(0,n_projects):
label="Hello"
xdate[i]=QtGui.QLabel()
xdate[i].setText(label)
self.ui.TW1.setCellWidget(13,i,xdate[i])
Then I could see the custom widgets without problem. Then in the program I want to change the text of the qlabels and reinserting using the following code:
for i in range(0,n_projects):
xdate[i].setText("Option"+str(i))
self.ui.TW1.setCellWidget(13,i,xdate[i])
and now the widgets doesn't appear in the table.
Why is happen this?
Many thanks for your help
German