Is it possible to change the color of a selected feature in qgis 2.2.0 Valmiera? To highlight a feature I use:  aLayer.Select(feat.id()) 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 a different color for this feature?
123030
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?
81138
I am a newbie with QGIS - I have just installed QGIS 2.10.1-Pisa. I am following a youtube tutorial by Steven Bernard and I just found that the styles do not work properly (I run Mac OS X Lion 7.5.1. on a 1.7 GHz Intel Core i5 MacBook Air).  When I want to change the sybology of my map, this does not work properly. If you have a look at step 3.2.3. Changing Symbol Structure in the manual on  , QGIS does not provide me with any choices. It tells me that 'This layer doesn't have any editable properties'. I am attaching a screenshot just to be clear.  Can anybody tell me what is wrong?
87584
I'm trying to change the Viewport background color. But I can't seem to find the right settings.    Anyone knows where to find it?
60424
I want to change the color of some text in my game. I've tried adding materials, but whenever I press P to play the game, the text stays the same white color. Any ideas?
122164
I'm trying to edit the value of an attribute for each feature in a layer using a QGIS Python plugin. I've found that doing this outside of editing mode is much slower than while editing (even including committing the edits). See code below (lines interchangeable at the same point in a loop). The difference in speed for my sample dataset is 2 seconds (edit mode) vs 72 seconds (not edit mode).  Modifying an attribute in edit mode:  layer.changeAttributeValue(feature.id(), 17, QtCore.QVariant(value))   Modifying an attribute outside of edit mode:  layer.dataProvider().changeAttributeValues({ feature.id() : { 17 : QtCore.QVariant(value) } })   Is this an expected behavior? I don't need the user to be able to undo the changes, so I don't think I need to use edit mode.  Edit 1: See full code below with both versions included (but commented out):  def run(self):     try:         # create spatial index of buffered layer         index = QgsSpatialIndex()         self.layer_buffered.select()         for feature in self.layer_buffered:             index.insertFeature(feature)          # enable editing         #was_editing = self.layer_target.isEditable()         #if was_editing is False:         #    self.layer_target.startEditing()          # check intersections         self.layer_target.select()         self.feature_count = self.layer_target.featureCount()         for feature in self.layer_target:             distance_min = None             fids = index.intersects(feature.geometry().boundingBox())             for fid in fids:                 # feature's bounding box and buffer bounding box intersect                 feature_buffered = QgsFeature()                 self.layer_buffered.featureAtId(fid, feature_buffered)                 if feature.geometry().intersects(feature_buffered.geometry()):                     # feature intersects buffer                     attrs = feature_buffered.attributeMap()                     distance = attrs[0].toPyObject()                     if distance_min is None or distance &lt; distance_min:                         distance_min = distance                 if self.abort is True: break             if self.abort is True: break              # update feature's distance attribute             self.layer_target.dataProvider().changeAttributeValues({feature.id(): {self.field_index: QtCore.QVariant(distance_min)}})             #self.layer_target.changeAttributeValue(feature.id(), self.field_index, QtCore.QVariant(distance_min))              self.calculate_progress()          # disable editing         #if was_editing is False:         #    self.layer_target.commitChanges()      except:         import traceback         self.error.emit(traceback.format_exc())     self.progress.emit(100)     self.finished.emit(self.abort)   Both methods produce the same result, but writing via the data provider takes much longer. The function classifies proximity of building features to nearby fields (purple) using pre-created buffers (brown-ish).
24275
I was trying to change the selected items color from the default orange to something else, however, the option isn't there, as it used to be in the Appearance properties in previous versions of ubuntu. Any idea where it could be in the beta?
58546
I'm new to pyqgis and I'm tryig to make a combobox with list of fields (from layer also selected in combobox).      layers = self.iface.legendInterface().layers()     layer_list = []     for layer in layers:         layer_list.append(layer.name())     self.dlg.comboBox.addItems(layer_list)       selectedLayerIndex = self.dlg.comboBox.currentIndex()     selectedLayer = layers[selectedLayerIndex]     fields = selectedLayer.pendingFields()     fieldnames = [field.name() for field in fields]     self.dlg.comboBox_2.addItems(fieldnames)   The problem is, that in second combobox there are fields from first on layerlist layer, not the selected one.
75075
I am using different shapefiles from open data in Switzerland. They have just updated the whole set. My question is: how to compared two layers (new and old version)? I would like to know the differences in geometry, as well as attributes. In the data there are points, lines and polygons and some of the sets contains a big amount of features (more than 300 000 elements). I have already checked all the simillar questions, but they all focus on creating the third layer with differences or particular layer example. What I want to know is just what has been changed. I am working with QGIS 2.14.3 and i am familiar with Python.
87680
I want to apply unique symbol to each feature. I have used following code for doing that from qgis.core import * from PyQt4.QtGui import * # supply path to where is your qgis installed QgsApplication.setPrefixPath(&quot;/path/to/qgis/installation&quot;, True) # load providers QgsApplication.initQgis()  # Get the active layer (must be a vector layer) layer = qgis.utils.iface.activeLayer(); iter = layer.getFeatures(); for feature in iter:     geom = feature.geometry()     print &quot;Feature ID %d: &quot; % feature.id()     qgis.utils.iface.mapCanvas().setSelectionColor( QColor(&quot;yellow&quot;) );     layer.setSelectedFeatures([feature.id()])     qgis.utils.iface.mapCanvas().zoomToSelected( layer )     qgis.utils.iface.mapCanvas().refresh()     selected_features = layer.selectedFeatures()     for i in selected_features:        attr =i.attributes()     chaltano= str(attr[layer.fieldNameIndex('test')])     renderer = QgsCategorizedSymbolRendererV2(&quot;test&quot;)     layer.setRendererV2(renderer)     symbol = QgsSymbolV2.defaultSymbol(layer.geometryType())     symbol.setColor(QColor(&quot;red&quot;))     cat = QgsRendererCategoryV2(feature.id(), symbol,str(feature.id()))     renderer.addCategory(cat)  Symbol is applying to only last feature. Here, &quot;test&quot; is attribute.
61798
I am trying to split a selected polygon ("regions") with a selected line from another layer ("streets") in QGIS 3.8.3. In the example below, I want to split the selected polygon coloured in yellow with the street pointed at by the blue arrow.    After reading the post , I realized I can't find it either. I installed the plugin, but the tool seems to be missing from my toolbar:
115075
I have a point shapefile with several numeric fields, among them FuelFlow and Slope. I have successfully applied colour to the various points according to the value of the FuelFlow field. Now I would like to control some other attribute of the map symbols (shape? size?) according to the value in the Slope field. Something like slope between 0 and 10 gets one display style, 10-20 gets a second style, 20-30 etc. I get the sense that this is possible in QGIS (using v 2.2.0 - Windows) according to some of the tools in the Style dialog, but I don't know where to start. Can someone point me in the right direction? I believe I saw one online posting about using a CASE statement in the style definition, but now 1) I can't find it in the UI and 2) I don't know how to construct the CASE statement.
114566
Guys, can someone give me a brief run through of how to change the background colour of a CEdit control at runtime? I want to be able to change the background to red if the field is zero length and the normal white otherwise.
56805
I work on QGIS 2.2, and I am unable to edit my attribute table to change the field type from string to double.  I have gone through several tutorials. - I can not run the table manager plugin, probably because its latest version is for qgis 2.0, (well it appears broken on my plugin manager UI).   I am unable to edit my layer so that I can use the field calculator (as several tutorials stipulated). I am not versed with python to use the python console
23336
When I change symbology for a given QgsVectorLayer (QGIS 2.14.16 LTR) by  r=iface.activeLayer().rendererV2() r.symbol().symbolLayers()[0].setColor(0,0,255,255)   as shown here:    and refreshing the map content by  iface.mapCanvas().refreshAllLayers()   I get the expected result, but the Layer Tree does not update as shown here:    What am I missing, and how can I update the Layer tree from PyQGIS programmatically?
48100
I think I must have changed a setting by accident.    Whenever I select an object and do any operation on it (move, rotate, scale, etc), suddenly the boxes in the Transform tab become yellow and the Animate property settings (The diamonds next to the yellow boxes on the right hand side of the photo) become activated.  I don't know what these are and what these do (I don't think they do anything atm), but I know this is not the default behavior.  How can I change this back to default behavior? (i.e. no yellow boxes, no diamonds)
95654
This may sound crazy, but I do not have an Add Feature button on my toolbar in QGIS 3.6.  Am I missing something?
88252
I have a Leaflet WMS Layer  layer = new L.tileLayer.wms('https://{s}.url.com/wms?', {     layers: 'Workspace:Layer',     format: 'image/png',     version: '1.3.0',     transparent: true,     styles: 'style1', });   If I choose 'style2', it works as expected, but I want to change it dynamically with a select box. I tried the following but it does not work:  &lt;select id="styles"&gt;     &lt;option selected="selected" onselect="layer.styles='style1';"&gt;Style1&lt;/option&gt;     &lt;option onselect="layer.styles='style2';"&gt;Style2&lt;/option&gt; &lt;/select&gt;   I also tried with layer.options.styles=''