A
Andrew Lepyokhin
Hello,
i'm still a ruby-newbie and will be very thankful for any advise.
I've got a table via QTableWidget. The size is set during program
execution by setRowCount/setColumnCount. Then i need to randomly fill
all cells.
I can't go .setText through every cell beacuse they're still Nill,
so i've done it like that:
for i in (0..self.rowCount-1) do
self.setCurrentCell(i, 0)
tmp=Qt::TableWidgetItem.new
tmp.setText(rand.to_s)
self.setItem(i, 0, tmp)
end
and here's the problem:
when table size is more than 1000x1000 my procedure is insanely slow
(because of so many .new items, i think).
So is there any good way of doing the same task without waiting for 2
minutes?
i'm still a ruby-newbie and will be very thankful for any advise.
I've got a table via QTableWidget. The size is set during program
execution by setRowCount/setColumnCount. Then i need to randomly fill
all cells.
I can't go .setText through every cell beacuse they're still Nill,
so i've done it like that:
for i in (0..self.rowCount-1) do
self.setCurrentCell(i, 0)
tmp=Qt::TableWidgetItem.new
tmp.setText(rand.to_s)
self.setItem(i, 0, tmp)
end
and here's the problem:
when table size is more than 1000x1000 my procedure is insanely slow
(because of so many .new items, i think).
So is there any good way of doing the same task without waiting for 2
minutes?