PyQGIS Standalone Crashes python.exe when zooming out too far / Process finished with

المشرف العام

Administrator
طاقم الإدارة
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()

أكثر...
 
أعلى