In QGIS selected features are normally highlighted in a different color to draw user’s attention on the selection. The default color can be changed programmatically. As a nice to have my standalone app (QGIS 2.8.2) should draw selected features with different stiles: points with another symbol or a greater size, maybe with a flashing effect, areas with hatch pattern drawn in a different orientation.

Any ideas on how to implement this?

My first idea was to switch between True and False in a hidden field whenever selectionChanged signal is emitted, but I am afraid of running in inconsistency and performance problems this way.

  • I think that, this is not possible, because one layer can have only one renderer. If you want selection in different style, you should create new layer with these objects and then create another renderer.
    – dmh126
    Jul 10, 2015 at 9:24
  • It's a feature planned for 2.12 I proposed during Nodebo Hackmeeting and in charge of Nyall Dawson. He is working in some new contextual staffs Jul 10, 2015 at 15:33
  • You can comment here the feature request: hub.qgis.org/issues/12879 Jul 10, 2015 at 15:40
  • 2
    In this moment is possible only creating a function in the expression editor where to check if a feature is selected or not... the drawback is that you have to fix by code the layer name or id. Jul 10, 2015 at 15:44


Browse other questions tagged or ask your own question.