Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
importing the right Qstring for Python 3 on windows
"""
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
You can’t perform that action at this time.