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

setIcon fails with PySide if incorrectly setting QT_API #46

Closed
ProvoK opened this issue May 9, 2016 · 6 comments
Closed

setIcon fails with PySide if incorrectly setting QT_API #46

ProvoK opened this issue May 9, 2016 · 6 comments

Comments

@ProvoK
Copy link

ProvoK commented May 9, 2016

I had the same problem as in this issue #23
but setting os.environ['QT_API'] = 'PySide' did not work for me.
I had to manually uninstall PyQt, but it's not good in terms of portability.
How could i fix that?

@ccordoba12 ccordoba12 changed the title setIcon fails setIcon fails with PySide May 13, 2016
@ccordoba12
Copy link
Member

@ProvoK, could you post a simple code snippet that's giving errors when you have both PyQt and PySide installed, so we can test it in our side? Thanks :-)

We've worked hard to make QtAwesome work with PyQt5, PyQt4 and PySide, but it seems there are some differences between them we haven't addressed correctly :-)

@ProvoK
Copy link
Author

ProvoK commented May 22, 2016

I'm very sorry for the late reply, i had uninstalled PyQt as "easy fix" since i needed my program running.
I found that the problem was pretty stupid, once i look'd into qtpy code.
It was os.environ['QT_API'] = 'pyside' instead of os.environ['QT_API'] = 'PySide' ...

@ProvoK ProvoK closed this as completed May 22, 2016
@Nodd
Copy link

Nodd commented May 22, 2016

We should accept the values whatever the letter case. It's just amatter of adding a .lower() at the correct place.

@ProvoK
Copy link
Author

ProvoK commented May 22, 2016

Yes, it would be nice, or give a better exception message.
Actually, if i change it to "PySide" it gives me this error
File "/home/vitto/TESI/PyDaMind/Client/Widgets/Welcome.py", line 9, in <module> import qtawesome as qta File "/usr/local/lib/python2.7/dist-packages/qtawesome/__init__.py", line 19, in <module> from .iconic_font import IconicFont, set_global_defaults File "/usr/local/lib/python2.7/dist-packages/qtawesome/iconic_font.py", line 22, in <module> from qtpy.QtCore import QObject, QPoint, QRect, qRound, Qt File "/usr/local/lib/python2.7/dist-packages/qtpy/__init__.py", line 68, in <module> assert os.environ[QT_API] in (PYQT5_API + PYQT4_API + PYSIDE_API) AssertionError
This made me look into that file and solve by myself

@ccordoba12 ccordoba12 reopened this May 22, 2016
@ccordoba12 ccordoba12 changed the title setIcon fails with PySide setIcon fails with PySide if incorrectly setting QT_API May 22, 2016
@ccordoba12
Copy link
Member

@Nodd is right, we should accept values of QT_API no matter if they are lower or upper-cased :-)

@ProvoK, we'll fix this one for the next qtpy release.

@goanpeca goanpeca modified the milestone: 0.4 Oct 13, 2016
@ccordoba12 ccordoba12 removed this from the 0.4 milestone Dec 30, 2016
@ccordoba12
Copy link
Member

This was fixed in qtpy 1.1.2, which is a dependency of qtawesome. Please update to that version.

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

No branches or pull requests

4 participants