[PyKDE] RE: Strange QTable behavior

Jim Bublitz jbublitz at nwinternet.com
Fri Dec 14 19:27:30 GMT 2001


On 14-Dec-01 "Tomaz Ficko"
<tomaz.ficko at agroruse.si>pykde-admin at mats.gmd.de wrote:

> I'm writing a dictionary like application with PyQt. I'm using
> QTable widget to display the data in a table with two columns.
> But there is a problem, when I set number of rows to more than
> 1638 and fill all cells with QTableItems the contents of the
> table become blank no grid, no nothing. If I double click a cell
> then the text becomes visible. So the QTableItems are
> there they are just not visible.  I have tried to use update,
> repaint method, and updateCell method but nothing helps.

> Is this bug or feature? Has somebody else noticed similar
> behavior?

> I want to be able to display 50000 rows in table, which widget
> should I use?

This is probably an "I don't know what I'm talking about, but I'll
answer anyway" reply. I developed a similar application using Qt
(but with C++) a while ago, the major difference being I had
millions of lines to display, so developed my own widget to page
the data. I know I had similar problems however, and I believe I
traced it to a problem with "setUpdatesEnabled" and the related
logic. 

I think it's something like Qt doesn't always set a related flag
correctly. Looking at my code quickly, I just used the widget's
repaint() method. When loading the table, I believe I turned off
updates until done, and then turned them on and repainted but had
to make sure to enable updates before repainting (or maybe do
something else). I don't think I can find the point(s) in the code
where this all happens in less than a few hours - sorry.

Maybe take a look at what the event handling for doubleclicking
does to make the cell appear, and then do that explicitly in code
for the entire table. 

Jim





More information about the PyQt mailing list