Bug report #811

selectionChanged() SIGNAL getting connected and disconnected on raster layers in qgsmapcanvas.cpp

Added by Aaron Racicot - over 16 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:Aaron Racicot -
Category:Map Canvas
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10870

Description

In qgsmapcanvas.cpp in QgsMapCanvas::setLayerSet a disconnect and connect call to selectionChanged signal are being made on the map layer set, but some of those layers can be raster layers. selectionChanged() is a signal that only vector layers can emit.

This bug causes warning messages to appear when calling setLayerSet via the python bindings with a layer set that contains rasters.

The solution is to wrap the disconnect and connect calls with logic to test if the layer is a vector layer.

bug811fix.diff Magnifier - Bug fix for Ticket #811 (2.86 KB) Aaron Racicot -, 2007-11-15 12:58 PM

History

#1 Updated by Aaron Racicot - over 16 years ago

  • Status changed from Open to In Progress

Turns out src/app/legend/qgslegendlayerfile.cpp also contains the issue... not only for selectionChanged() but for wasModified(bool) as well. Both of these need to be connected only to vector layers. Attached is a patch to wrap all of these cases to check for vector layer.

#2 Updated by Marco Hugentobler over 16 years ago

  • Resolution set to fixed
  • Status changed from In Progress to Closed

Applied in bd3fd856 (SVN r7417). Many thanks for the input!

#3 Updated by Anonymous over 14 years ago

Milestone Version 0.9.1 deleted

Also available in: Atom PDF