File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 22"""
33
44import os
5- import warnings
6- from matplotlib import rcParams
5+ from matplotlib import rcParams , verbose
76
87# Available APIs.
98QT_API_PYQT = 'PyQt4' # API is not set here; Python 2.x default is V 1
3635if QT_API in (QT_API_PYQT , QT_API_PYQTv2 ):
3736 import sip
3837 if QT_API == QT_API_PYQTv2 :
39- sip .setapi ('QString' , 2 )
40- sip .setapi ('QVariant' , 2 )
38+ if QT_API_ENV == 'pyqt' :
39+ cond = ("Found 'QT_API=pyqt' environment variable. "
40+ "Setting PyQt4 API accordingly.\n " )
41+ else :
42+ cond = "PyQt API v2 specified."
43+ try :
44+ sip .setapi ('QString' , 2 )
45+ except :
46+ res = 'QString API v2 specification failed. Defaulting to v1.'
47+ verbose .report (cond + res , 'helpful' )
48+ # condition has now been reported, no need to repeat it:
49+ cond = ""
50+ try :
51+ sip .setapi ('QVariant' , 2 )
52+ except :
53+ res = 'QVariant API v2 specification failed. Defaulting to v1.'
54+ verbose .report (cond + res , 'helpful' )
4155
4256 from PyQt4 import QtCore , QtGui
4357
You can’t perform that action at this time.
0 commit comments