Re: [PyQt] qtable data source

2007-12-23 Thread Sibylle Koczian
Am Sonntag, 23. Dezember 2007 06:50:44 schrieb nishith datta:
 hi all,
   I wish to show the output of my sql query in  a table.
   I am unable to do that.
   Can someone point out some resource / example or documentation to help me
 out. thanks in advance

http://doc.trolltech.com/4.0/sql.html

Is this no good? If no, why not? Or, of course, the book: Mark Summerfield, 
Rapid GUI programming with Python and Qt, Prentice Hall 2007, ISBN 
0-13-235418-7.

Sibylle

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] qtable data source

2007-12-23 Thread nishith datta
Ok ,
  I went throught he documentation before and yet again.
  I can't figure out what the hell is wrong with this code ;-
  import sys
from PyQt4 import QtGui, QtSql
   
  db = QtSql.QSqlDatabase.addDatabase(QPSQL)
db.setHostName(localhost)
db.setPort(5432)
db.setDatabaseName(test)
db.setUserName(root)
db.setPassword(mypass)
print db.open()
   
  Always returns a false , however with psycopg2 , I am able to execute query 
too. 
  Can someone help me out with understanding whatz wrong with the code fragment 
above ?
  thanks
  nishith

   
-
Never miss a thing.   Make Yahoo your homepage.___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] qtable data source

2007-12-23 Thread Andreas Pakulat
On 23.12.07 11:05:18, nishith datta wrote:
 Ok ,
   I went throught he documentation before and yet again.
   I can't figure out what the hell is wrong with this code ;-
   import sys
 from PyQt4 import QtGui, QtSql

   db = QtSql.QSqlDatabase.addDatabase(QPSQL)
 db.setHostName(localhost)
 db.setPort(5432)
 db.setDatabaseName(test)
 db.setUserName(root)
 db.setPassword(mypass)
 print db.open()

   Always returns a false , however with psycopg2 , I am able to execute query 
 too. 

You don't create a QApplication or QCoreApplication, thats needed before
doing any sql-stuff with Qt. It works fine over here.

Andreas

-- 
Don't go surfing in South Dakota for a while.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] qtable data source

2007-12-22 Thread nishith datta
hi all,
  I wish to show the output of my sql query in  a table.
  I am unable to do that.
  Can someone point out some resource / example or documentation to help me out.
  thanks in advance
  nishith

   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt