Add PyQt6 version check for QByteArray creation
This commit is contained in:
parent
cabcf6cd29
commit
4264219144
@ -1708,8 +1708,7 @@ def arrayToQPath(x, y, connect='all', finiteCheck=True):
|
|||||||
# make connect argument contain only str type
|
# make connect argument contain only str type
|
||||||
connect_array, connect = connect, 'array'
|
connect_array, connect = connect, 'array'
|
||||||
|
|
||||||
qtver = [int(x) for x in QtVersion.split('.')]
|
qt6 = QtVersion.startswith("6")
|
||||||
qt6 = qtver[0] == 6
|
|
||||||
|
|
||||||
use_qpolygonf = connect == 'all' or (qt6 and connect in ['pairs', 'finite'])
|
use_qpolygonf = connect == 'all' or (qt6 and connect in ['pairs', 'finite'])
|
||||||
|
|
||||||
@ -1731,7 +1730,7 @@ def arrayToQPath(x, y, connect='all', finiteCheck=True):
|
|||||||
# inf/nans completely prevent the plot from being displayed starting on
|
# inf/nans completely prevent the plot from being displayed starting on
|
||||||
# Qt version 5.12.3; these must now be manually cleaned out.
|
# Qt version 5.12.3; these must now be manually cleaned out.
|
||||||
isfinite = None
|
isfinite = None
|
||||||
|
qtver = [int(x) for x in QtVersion.split('.')]
|
||||||
if connect == 'finite' and qt6:
|
if connect == 'finite' and qt6:
|
||||||
# we must preserve NaN values here
|
# we must preserve NaN values here
|
||||||
pass
|
pass
|
||||||
@ -1794,7 +1793,7 @@ def arrayToQPath(x, y, connect='all', finiteCheck=True):
|
|||||||
|
|
||||||
# create QDataStream object and stream into QPainterPath
|
# create QDataStream object and stream into QPainterPath
|
||||||
path.strn = backstore
|
path.strn = backstore
|
||||||
if QT_LIB == "PyQt6":
|
if QT_LIB == "PyQt6" and QtCore.PYQT_VERSION < 0x60101:
|
||||||
# due to issue detailed here:
|
# due to issue detailed here:
|
||||||
# https://www.riverbankcomputing.com/pipermail/pyqt/2021-May/043942.html
|
# https://www.riverbankcomputing.com/pipermail/pyqt/2021-May/043942.html
|
||||||
buf = QtCore.QByteArray(path.strn, len(path.strn))
|
buf = QtCore.QByteArray(path.strn, len(path.strn))
|
||||||
|
Loading…
Reference in New Issue
Block a user