1

I have the following PyQGIS Standalone App which is working fine so far. One little problem is that if I zoom out to the MaxExtent(by scrolling the mousewheel) the app crashes python.exe so that the windows error report is startet. Has anyone else encountered this problem and knows how to prevent it?

The error message is:

Process finished with exit code -1073741819 (0xC0000005)

from qgis.core import *
from qgis.gui import *
from qgis.utils import *
from PyQt4 import *
from PyQt4 import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *

# import Tkinter
# from Tkinter import *
import sys
#from qgis.core import QgsApplication
#from qgis.gui import QgsMapCanvas
import os

qgishome = r"C:/OSGeo4W64/apps/qgis"

app = QgsApplication([], True)
QgsApplication.setPrefixPath(qgishome, True)
QgsApplication.initQgis()
if len(QgsProviderRegistry.instance().providerList()) == 0:
    raise RuntimeError('No data providers available.')

canvas = QgsMapCanvas()
canvas.setCanvasColor(Qt.white)
canvas.enableAntiAliasing(True)
canvas.show()

layer = QgsVectorLayer("C:/daten/gwdat_31468.shp", "Grundwasserdaten", "ogr")
reg = QgsMapLayerRegistry.instance()
reg.addMapLayer(layer)
canvas.setExtent(layer.extent())
canvas.setLayerSet([QgsMapCanvasLayer(layer)])
#QgsApplication.exitQgis()

app.exec_()

app.exitQgis()

Here's the version of QGIS i used: enter image description here

  • i gave it a try and it also caused python.exe to freeze. I had a look at the windows event viewer: the Path of the module that causes the error is: C:\OSGEO4~1\bin\QtGui4.dll – Thomas B Jun 30 '15 at 19:12
  • Which version of QGIS is this? – ndawson Jul 1 '15 at 1:58
  • it's 2.8.2, just added a screenshot with more information above – Schlockspecht Jul 1 '15 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.