Skip to content
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

Merged
merged 2 commits into from
Apr 11, 2016

Conversation

Qlogin
Copy link
Contributor

@Qlogin Qlogin commented Dec 25, 2015

fix crash on shortcut assignment (Qt5 'dataChanged' signal has 3 parameters)

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)
Copy link
Member

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))

@ccordoba12
Copy link
Member

I agree with @goanpeca too.

@goanpeca
Copy link
Member

@Qlogin any updates?

check the current API in use and then feed the correct connection
@Qlogin
Copy link
Contributor Author

Qlogin commented Dec 29, 2015

Sorry. Problems with e-mail notifications.
Updates have been committed

@goanpeca
Copy link
Member

Neat!, thanks, this is good to go, right @ccordoba12 ?

@goanpeca goanpeca changed the title Crashing on shortcut assignment with PyQt5 PR: Crashing on shortcut assignment with PyQt5 Jan 27, 2016
@goanpeca
Copy link
Member

@ccordoba12 ?

@ccordoba12 ccordoba12 added this to the v3.0beta3 milestone Apr 11, 2016
@ccordoba12 ccordoba12 merged commit 308e42c into spyder-ide:master Apr 11, 2016
@ccordoba12
Copy link
Member

@Qlogin, thanks a lot for your contribution and sorry for the big delay in merging :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants