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

Terry Barnaby terry at beam.demon.co.uk
Fri Apr 19 14:07:54 BST 2002


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.

Cheers

Terry

--
  Dr Terry Barnaby                     BEAM Ltd
  Phone: +44 1454 324512               Northavon Business Center, Dean Rd
  Fax:   +44 1454 313172               Yate, Bristol, BS37 5NH, UK
  Email: terry at beam.demon.co.uk        Web: www.beam.demon.co.uk
  BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software Dev
                         "Tandems are twice the fun !"







More information about the PyQt mailing list