[Qgis-developer] please help me write a QGIS-PostGIS GUI in Python

Maciej Sieczka tutey at o2.pl
Fri Feb 1 16:32:00 EST 2008


Barry Rowlingson pisze:
> Maciej Sieczka wrote:

>> I can't make the "Connect" button call the addNewConnection from Python.

>  That's because you haven't written the addNewConnection method!
> 
>  When the button is clicked, the on_btnNew_clicked method is called - 
> you then have to write the code you want it to do when you click it. So 
> inside the class QgsDbSourceSelectBase you need to do:
> 
>    def addNewConnection(self):
>      # create a new connection...
> 
>      # insert your code here..

Barry,

Sorry I'm slow. I thought, that since this code is already there in 
src/app/qgsdbsourceselect.cpp, I just have to call it from Python.

> get writing!

:). So do I need to translate the:

void QgsDbSourceSelect::addNewConnection()
{
   QgsNewConnection *nc = new QgsNewConnection(this);

   if (nc->exec())
   {
     populateConnectionList();
   }
}

into Python? Thus the whole src/app/qgsnewconnection.cpp too?

These question propably are dumb. I hope you can stand them...

Maciek



More information about the Qgis-developer mailing list