From f99d88100ba0bd82f0f0b5ff1d85c87001e3ecde Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 25 Dec 2015 14:05:48 +0300 Subject: [PATCH 1/2] Update shortcuts.py fix crash on shortcut assignment (Qt5 'dataChanged' signal has 3 parameters) --- spyderlib/plugins/shortcuts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spyderlib/plugins/shortcuts.py b/spyderlib/plugins/shortcuts.py index 0621a0b178f..34489ed05d1 100644 --- a/spyderlib/plugins/shortcuts.py +++ b/spyderlib/plugins/shortcuts.py @@ -789,8 +789,9 @@ def setup_page(self): self.setTabOrder(self.finder, self.reset_btn) # Signals and slots + # Qt5 'dataChanged' has 3 parameters self.table.proxy_model.dataChanged.connect( - lambda i1, i2, opt='': self.has_been_modified(opt)) + lambda i1, i2, roles=[], opt='': self.has_been_modified(opt)) self.reset_btn.clicked.connect(self.reset_to_default) def check_settings(self): From 3214312be08ae6cb8e750a57ed9ff266640e3521 Mon Sep 17 00:00:00 2001 From: Roman Kulagin Date: Tue, 29 Dec 2015 18:09:06 +0300 Subject: [PATCH 2/2] Update shortcuts.py check the current API in use and then feed the correct connection --- spyderlib/plugins/shortcuts.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spyderlib/plugins/shortcuts.py b/spyderlib/plugins/shortcuts.py index 34489ed05d1..7e7195b0413 100644 --- a/spyderlib/plugins/shortcuts.py +++ b/spyderlib/plugins/shortcuts.py @@ -789,9 +789,13 @@ def setup_page(self): self.setTabOrder(self.finder, self.reset_btn) # Signals and slots - # Qt5 'dataChanged' has 3 parameters - self.table.proxy_model.dataChanged.connect( - lambda i1, i2, roles=[], opt='': self.has_been_modified(opt)) + if PYQT5: + # Qt5 'dataChanged' has 3 parameters + self.table.proxy_model.dataChanged.connect( + lambda i1, i2, roles, opt='': self.has_been_modified(opt)) + else: + self.table.proxy_model.dataChanged.connect( + lambda i1, i2, opt='': self.has_been_modified(opt)) self.reset_btn.clicked.connect(self.reset_to_default) def check_settings(self):