Hot answers tagged pyqgis
Following Polygeo's suggestion: It is a problem of Python and the Windows registry: For the moment, PyScripter can only use the Python versions that have entries in the Windows registry (as the official Python distribution versions, the Enthought Python Distribution or ArcPy) The standalone QGIS installer installs Python 2.7 but does not create any ...
That documentation in the cookbook is a little out of date. You shouldn't need to use QString at all now, and the following code should work: actionZoomIn = QAction("Zoom in", self) actionZoomOut = QAction("Zoom out", self) actionPan = QAction("Pan", self) Basically, just remove all references to QString - they'll be converted automatically behind the ...
from PyQt4.QtGui import QApplication, QTableView # Get a list of all open attribute table dialogs attrTables = [d for d in QApplication.instance().allWidgets() if d.objectName() == u'QgsAttributeTableDialog' or d.objectName() == u'AttributeTable' ] # Set the column width for the first column in the first dialog to 200 ...
Yes: 1) The proposed solution (Using processing algorithms from the console) import processing # find the algorithm processing.alglist("Multipart to singleparts") Multipart to singleparts----------------------------->qgis:multiparttosingleparts # help processing.alghelp("qgis:multiparttosingleparts") ALGORITHM: Multipart to singleparts ...
http://www.qgis.org/en/docs/pyqgis_developer_cookbook/composer.html has a simple Python example. http://spatialgalaxy.net/2012/01/27/qgis-running-scripts-in-the-python-console/ has a more detailed example.
You have to configure a new interpreter. The python selected for the interpreter should be the OSGeo4w Python, not the system Python. For any given Pydev project you pick which interpreter to use. That way ArcPy and OSGeo Python are never together in the path. Just update, the paths and versions to match. ...
That was just discussed on the mailing list: #add toolbar tb = iface.addToolBar("My Toolbar") #remove toolbar del tb I don't think you can disable the standard toolbars that way though. Maybe look into the customization functionality instead.
This is a bug in 2.2 with the canvas and it's redraw event. The redraw event is called when the widget is first shown and it kicks off a timer which stops the canvas from painting. The workaround is as simple as calling: canvas.refresh() canvas.repaint() The first time the widget is shown.
Only top voted, non community-wiki answers of a minimum length are eligible