Created
October 2, 2011 10:58
-
-
Save mattions/1257345 to your computer and use it in GitHub Desktop.
importing the right Qstring for Python 3 on windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is a check to make sure the sip and the Qstrings play nicely in Windows, | |
where the PySide is using the new Python API (Python 3) | |
http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg19702.html | |
http://stackoverflow.com/questions/1400858/how-to-create-qstring-in-pyqt4 | |
This could be easily removed when we move to Python 3 | |
""" | |
if os.name == 'nt': | |
import sip | |
sip.setapi('QString', 2) | |
sip.setapi('QVariant', 2) | |
from PyQt4.QtCore import (Qt, SIGNAL, SLOT, QSize, QString, | |
pyqtSignature, pyqtProperty) | |
from PyQt4.QtCore import * | |
else: | |
from PyQt4 import QtGui, QtCore, uic | |
from PyQt4.QtCore import Qt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment