@@ -105,7 +105,7 @@ def _create_qApp():
105105 app = QtWidgets .QApplication .instance ()
106106 if app is None :
107107 # check for DISPLAY env variable on X11 build of Qt
108- if is_pyqt5 () :
108+ if QtCore . QT_VERSION_STR >= "5." :
109109 try :
110110 importlib .import_module (
111111 # i.e. PyQt5.QtX11Extras or PySide2.QtX11Extras.
@@ -130,11 +130,10 @@ def _create_qApp():
130130 else :
131131 qApp = app
132132
133- if is_pyqt5 ():
134- try :
135- qApp .setAttribute (QtCore .Qt .AA_UseHighDpiPixmaps )
136- except AttributeError :
137- pass
133+ try :
134+ qApp .setAttribute (QtCore .Qt .AA_UseHighDpiPixmaps )
135+ except AttributeError :
136+ pass
138137
139138
140139def _allow_super_init (__init__ ):
@@ -332,7 +331,7 @@ def mouseReleaseEvent(self, event):
332331 FigureCanvasBase .button_release_event (self , x , y , button ,
333332 guiEvent = event )
334333
335- if is_pyqt5 () :
334+ if QtCore . QT_VERSION_STR >= "5." :
336335 def wheelEvent (self , event ):
337336 x , y = self .mouseEventCoords (event )
338337 # from QWheelEvent::delta doc
@@ -699,7 +698,7 @@ def basedir(self):
699698 return str (cbook ._get_data_path ('images' ))
700699
701700 def _icon (self , name , color = None ):
702- if is_pyqt5 () :
701+ if QtCore . QT_VERSION_STR >= '5.' :
703702 name = name .replace ('.png' , '_large.png' )
704703 pm = QtGui .QPixmap (str (cbook ._get_data_path ('images' , name )))
705704 qt_compat ._setDevicePixelRatio (pm , qt_compat ._devicePixelRatio (self ))
@@ -896,9 +895,7 @@ def __init__(self, toolmanager, parent):
896895
897896 @property
898897 def _icon_extension (self ):
899- if is_pyqt5 ():
900- return '_large.png'
901- return '.png'
898+ return '_large.png' if QtCore .QT_VERSION_STR >= '5.' else '.png'
902899
903900 def add_toolitem (
904901 self , name , group , position , image_file , description , toggle ):
0 commit comments