fix: QVector3D has no copy constructor

This commit is contained in:
KIU Shueng Chuan 2021-05-13 08:23:06 +08:00
parent 96e83b7d43
commit 60661f586f
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@ class Vector(QtGui.QVector3D):
if len(vals) != 3:
raise Exception('Cannot init Vector with sequence of length %d' % len(args[0]))
initArgs = vals
elif isinstance(args[0], QtGui.QVector3D):
# PySide6 6.1 does not accept initialization from QVector3D
initArgs = args[0].x(), args[0].y(), args[0].z()
elif len(args) == 2:
initArgs = (args[0], args[1], 0)
QtGui.QVector3D.__init__(self, *initArgs)