is it possible to change the color of a selected feature in qgis 1.8? To highlight a feature I use:
vlayer.setSelectedFeatures(selectedList)
box = vlayer.boundingBoxOfSelected()
qgis.utils.iface.mapCanvas().setExtent(box)
qgis.utils.iface.mapCanvas().refresh()
But the selected featue is colored yellow. Is it possible to define for example a red color for this feature?
Answer
For reference, if you use QGIS >= v.2.4, you can set the selection color from the QGIS Python console in this way:
from PyQt4.QtGui import QColor
iface.mapCanvas().setSelectionColor( QColor("red") )
No comments:
Post a Comment