-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Crashing on shortcut assignment with PyQt5 #2881
Conversation
fix crash on shortcut assignment (Qt5 'dataChanged' signal 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Qlogin, thanks for working on this.
I think that to make the code much clearer to future contributors we could check the current API in use and then feed the correct connection
Like
from spyderlib.qt import PYQT5
...
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))
I agree with @goanpeca too. |
@Qlogin any updates? |
check the current API in use and then feed the correct connection
Sorry. Problems with e-mail notifications. |
Neat!, thanks, this is good to go, right @ccordoba12 ? |
@Qlogin, thanks a lot for your contribution and sorry for the big delay in merging :-) |
fix crash on shortcut assignment (Qt5 'dataChanged' signal has 3 parameters)