-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
selectionChanged signal emitted on Mac without arguments #21767
Comments
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Sebastian Dietrich (Sebastian Dietrich) Note that @selectionChanged@ is an overloaded signal that comes in two variants, one with 3 arguments and one without any arguments:
Apparently the overload that is used by default on Windows is the first one, while on Mac the second one is used. As a workaround try specifying the exact overload you want to connect:
This also works on Windows. |
Author Name: Nyall Dawson (@nyalldawson) Can you test with master? This should already be fixed |
Author Name: Jeff Lifemapper Project (Jeff Lifemapper Project) specifying the exact overload in mac doesn't work, for 2.12 or for 2.8.4 (returned to LTR on KyngChaos just to make sure) lyr.selectionChanged['QgsFeatureIds', 'QgsFeatureIds', bool].connect(mySlot) TypeError: C++ type 'QgsFeatureIds' is not supported as a signal argument type |
Author Name: Nyall Dawson (@nyalldawson) Hi Jeff, Can you test with a nightly snapshot please? We want to verify if changes made a few weeks ago fixed this, but they are NOT included in 2.12/2.8.4
|
Author Name: Jeff Lifemapper Project (Jeff Lifemapper Project) Yes, I found the nightly at http://qgis.dakotacarto.com/, and tested 2.13 dev. It seems to work, both as the default (sending the selected, deselected, clear and Select by default), and the 'QgsFeatureIds' doesn't throw an error should you have to specify the exact overload. Thank you |
Author Name: Jürgen Fischer (@jef-n) Fixed in changeset "5f86422942f73dc6e52c42945c4760fe0674d8c5".
|
Author Name: Jeff Cavner (Jeff Cavner)
Original Redmine Issue: 13740
Affected QGIS version: 2.12.0
Redmine category:python_plugins
On OSX Yosemite, 10.10.5, both QGIS version 2.10 and 2.12 (KyngChaos installer), GDAL 1.11., When selectionChanged signal for QgsVectorLayer is connected to a user defined slot and the signal is emitted it doesn't send the selected, unselected, clearAndSelect arguments. Programmaticly using select and setSelectedFeatures and manually selecting cause this behaviour. The problem does not exist for Windows 7 Professional or Ubuntu, only OSX.
So:
lyr = iface.activeLayer()
def mySlot(selected, unselected, clearAndSelect):
print "here"
lyr.selectionChanged.connect(mySlot)
Make a Selection on the canvas
TypeError: mySlot() takes exactly 3 arguments (0 given)
The text was updated successfully, but these errors were encountered: