I\'m creating a plugin in Quantum GIS that is using Postgres as the back end and QT Designer to make the GUI. I\'m using psycopg2 to run scripts in the database and even fetch r
If you're planning to use Qt widgets and models, PySide (PyQt, or plain Qt/C++) is the way to go.
With bare psycopg2
you'll have a lot more work to do, and you'll need to implement your own model in order to leverage Qt's model/view classes. This is simply not the Qt way of doing things. PySide (and PyQt) has it own means to connect to a supported database, there's no need for pure Python database adapters like psycopg2
. It uses the underlying libqt4-sql library (C++) and the installed plugins (QPSQL, QMYSQL, QSQLITE, etc).
Essentially you need to:
Take a look at the PySide QtSql Documentation and the PyQt documentation to get an idea. They're mostly compatible/interchangeable, but at a glance I see that the PyQt documentation looks more complete.
EDIT (after your edit):
A Qt GUI application requires an event loop to run, and that's provided by a QApplication
instance. Before going any further with the specifics of your app, take the time to understand a few basic concepts first. Here's a nice Getting Started with PyQt Guide.