[PyQt] QSqlQueryModel works but QSqlTableModel doesn't work

Ivan Coronado icoronado at epcge.com
Tue Mar 4 17:14:41 GMT 2008


Ja ja ja, yes, now the table has 15 records. Using QSqlQueryModel I can see the records. Another rare thing, If I use QSqlTableModel I only see the column names, but If I click in any header of the table, all the column names disappear.

Thanks for the reply Simone


-------------------------------------------------------------
Iván Coronado
IT Manager
icoronado at epcge.com
943 82 00 10
Engine Power Components Group Europe
 

-----Mensaje original-----
De: pyqt-bounces at riverbankcomputing.com [mailto:pyqt-bounces at riverbankcomputing.com] En nombre de Simone
Enviado el: martes, 04 de marzo de 2008 16:00
Para: pyqt at riverbankcomputing.com
Asunto: Re: [PyQt] QSqlQueryModel works but QSqlTableModel doesn't work

Ivan Coronado ha scritto:

>         self.tb= QtSql.QSqlTableModel()   
>         self.tb.setTable("condicionesref") #if I change the table works ok
>         self.tb.setEditStrategy(QtSql.QSqlTableModel.OnManualSubmit)
>         self.tb.select() #returns False
>         print self.tb.rowCount() #returns 0
>         self.ui.tvOpcionesReglas.setModel(self.tb)
>         self.ui.tvOpcionesReglas.show() #only show the column names

Stupid question: is there any records on the table?

Simone
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 

_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



More information about the PyQt mailing list