Hi
I think there are two approaches:
1) Install Xvfb and start it with the following command (and export DISPLAY):
Xvfb :99 -ac -noreset &
export DISPLAY=:99
2) Try to use QCoreApplication instead of QApplication:
app = QApplication(sys.argv)
QgsApplication.setPrefixPath("/home/stefan/Apps/qgis_master", True)
QgsApplication.initQgis()
I don't know what the drawbacks are when using QCoreApplication.
Regards
Stefan
> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:qgis-developer-
> [email protected]] Im Auftrag von [email protected]
> Gesendet: Dienstag, 9. Dezember 2014 17:12
> An: [email protected]
> Betreff: Re: [Qgis-developer] Error : cannot connect to X server on Ubuntu
>
> >>on X-server,
>
> I want to run it in a headless mode i.e no GUI. I want to be able to invoke
> in batch
> mode ( ie headless standalone) a model developed via graphical modelling
> tool of qgis.
>
> So, ideally i dont want to connect to x-server
>
> this is needed for automation purpose.
>
> Cant really use python consol from qgis.
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Error-cannot-
> connect-to-X-server-on-Ubuntu-tp5177029p5177061.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer