[PyKDE] Problem with QTable and QTableItem with PyQT-2.4 and PyQT-3.1

Phil Thompson phil at river-bank.demon.co.uk
Sat Apr 20 18:45:29 BST 2002


Terry Barnaby wrote:

> > > Hi,
> > >
> > > I am trying to use the QTable and QTableItem classes and seem to have a problem.
> > > If I use setText() to create a table cell it works fine.
> > > If however I create the QTableItem() manually (In the same way as the C++ version
> > > of setText() does it) and add the item using setItem() there is no text displayed
> > > in the cell. Creating a C++ version of the code works fine.
> > >
> > > t = QTable(5, 10, s)
> > > t.show()
> > >
> > > t.setText(0, 0, "Hello");
> > > i = QTableItem(t, QTableItem.OnTyping, "HH", QPixmap());
> > > print "Item:", i, i.text();
> > > t.setItem(0, 1, i);
> > >
> > > Any ideas ?
> > > I enclose the code that fails.
> > > We are using RedHat 7.2, Python 1.5 and Python 2.1 with QT 2.3.1.

It's a bug. It will be fixed in v3.2.

Phil





More information about the PyQt mailing list