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

Incorrect setting of Qt API n°2 #2282

Closed
MatthieuDartiailh opened this issue Mar 27, 2015 · 6 comments · Fixed by #2286
Closed

Incorrect setting of Qt API n°2 #2282

MatthieuDartiailh opened this issue Mar 27, 2015 · 6 comments · Fixed by #2286

Comments

@MatthieuDartiailh
Copy link
Contributor

Even when the API n°2 is selected some Qt objects still use the API n°1. I typically get this type of warning each time I run one of my program (which use the enaml library which sets those to API n°2) :

Warning/PyQt4-Spyder (API 'QDate' has already been set to version 1)
Warning/PyQt4-Spyder (API 'QDateTime' has already been set to version 1)
Warning/PyQt4-Spyder (API 'QTextStream' has already been set to version 1)
Warning/PyQt4-Spyder (API 'QTime' has already been set to version 1)
Warning/PyQt4-Spyder (API 'QUrl' has already been set to version 1)

As we can ignore the sip setapi errors and that my program actually does not use those it is fine but still not ideal
If anybody can point me to the where this is set in Spyder I will be happy to do a PR to fix that.

@Nodd
Copy link
Contributor

Nodd commented Mar 27, 2015

👍

@ccordoba12
Copy link
Member

Is this happening in 2.3.4 or in master? Qt API 1 won't be supported since Spyder 3.0, and we are not going to release more bug fixes for 2.3.

So my recommendation would be to switch to master, and if you continue to see these errors, then we can see what we can do about them. Else, you should wait unitl 3.0 is released (hopefully in the summer :-)

@MatthieuDartiailh
Copy link
Contributor Author

I can confirm that this still happens into latest master.

@ccordoba12
Copy link
Member

Ok, I don't understand what can be happening in this case. So please give us a simple and reproducible example that we can use to test and fix this problem in our side.

@Nodd
Copy link
Contributor

Nodd commented Mar 30, 2015

I have the same problem. With a grep setapi I found:

spyderlib/qt/__init__.py:34:        sip.setapi('QString', 2)
spyderlib/qt/__init__.py:35:        sip.setapi('QVariant', 2)

There are other apis that are not set to version 2, see http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
The fix is very easy, it's only a matter of using setapi on missing values.

@ccordoba12
Copy link
Member

Thanks @Nodd for the reference and @MatthieuDartiailh for the PR. That's definitely the way to go as a team!!

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

Successfully merging a pull request may close this issue.

3 participants