I have a polygon vector layer with Simple line symbology. When I select one from Attribute table, QGIS change the boundary color in yellow, but I have difficulties to find it easily between many polygons. I need every time to click on "Zoom to the selected rows". Is there a way to fill with color a polygon when it is selected as ArcGIS software?

3 Answers 3

  1. Create a new symbol layer of Geometry Generator and Simple Fill type with this expression:

    case when is_selected() then $geometry end

    This creates a new style that is used for selected polygons only.

  2. To change the color of selected features, go to Menu Settings > Options > Tab Canvas&Legends > Selection Color.


Since I couldn't find a manual solution, I use a script for that kind of purpose. Run the following script in QGIS Python Editor. It opens the attribute table of the layer. When you select a row in the table, it zooms to the selected feature automatically.

layer_name = "polygon_layer"

lyr = QgsProject.instance().mapLayersByName(layer_name)[0]
def zoom_selected_feature(i):
attr_table = iface.showAttributeTable(lyr)
table = attr_table.findChildren(QTableView)[0]

enter image description here

  • The script is quite interesting, but what I needed was the Babel's solution. Thanks anyway
    – Lion
    Commented Nov 29, 2022 at 14:49

A third, and manual, alternative to the other two answers currently posted, is to change the polygon layer's symbology from Outline: Simple Line to Simple Fill with a transparent fill. That's done by

  1. Navigating to the layer's symbology properties.
  2. Choosing Symbol layer type = Simple Fill in dropdown.
  3. Picking Fill color = Transparent Fill as shown below.

enter image description here

QGIS will then show outlines for unselected polygons in the layer and fill the polygons which are selected. (As of QGIS 3.22.14 setting the layer's Fill style to No Brush also produces this result, regardless of the fill color chosen.) For example, with the default yellow selection color a single selected polygon would then look something like this:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.