pyqt4 qTableWidget add items help

Sebastian Wiesner basti.wiesner at gmx.net
Sat Apr 18 12:46:29 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<ookrin – Samstag, 18. April 2009 11:58>

[...]
> I've been trying
> 
>         while(len(orders)> i):
>             ui.tb1_tblOrders.setCurrentCell(i,0,orders[i][1])
>             i+=1
> 
> which to me, says go add in the first column row with the first order,
> and it makes sense to me
Read the documentation [1] to learn, what ".setCurrentCell()" actually does 
and what its arguments are!  And please stop this wild guessing ...

The method you're searching for is ".setItem()" [2], which adds a new 
QTableWidgetItem [3] to a QTableWidget. 

[1] http://doc.trolltech.com/4.5/qtablewidget.html#setCurrentCell
[2] http://doc.trolltech.com/4.5/qtablewidget.html#setItem
[3] http://doc.trolltech.com/4.5/qtablewidgetitem.html

- -- 
Freedom is always the freedom of dissenters.
                                      (Rosa Luxemburg)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)

iEYEARECAAYFAknpr4sACgkQGV4vxEMMOxdnawCfTXO55EffBJMQ7h91RGtMIpZ/
hcYAoLQ9yF5u/hBgNRvqxGRlIy5lPDgb
=Q6ef
-----END PGP SIGNATURE-----




More information about the Python-list mailing list