Bug report #3286
Qgis segfaults instanciating QgsComposition from python
|Affected QGIS version:||Regression?:||No|
|Operating System:||Linux||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||invalid|
|Crashes QGIS or corrupts data:||Copied to github as #:||13346|
crashes immediately after:
composition = core.QgsComposition(render)
Tested with trunk, 1.5 and 1.6
#1 Updated by Marco Hugentobler almost 10 years ago
#2 Updated by Alessandro Pasotti almost 10 years ago
Hi, I tested your patch but it still crashes. BTW I suspect it's a bug in QT and I found a way to make it work, it seems like QGraphicsScene (from which QgsComposition inherits, needs a QApplication instance, so this line needs to be added before the call to QgsComposition constructor.
app = [[QtGui]].QApplication(sys.argv, [[QtGui]].QApplication.Tty)
I thought having called QgsApplication.initQgis would have been enough to have a QApplication instance.
You can probably close this bug.