mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Undo old testcode, added testcode for CURA-3334
This commit is contained in:
parent
f885f3e1dd
commit
ccac9277a9
3 changed files with 23 additions and 8 deletions
|
@ -6,7 +6,6 @@ from PyQt5.QtCore import QVariantAnimation, QEasingCurve
|
|||
from PyQt5.QtGui import QVector3D
|
||||
|
||||
from UM.Math.Vector import Vector
|
||||
from UM.Logger import Logger
|
||||
|
||||
|
||||
class CameraAnimation(QVariantAnimation):
|
||||
|
@ -15,7 +14,6 @@ class CameraAnimation(QVariantAnimation):
|
|||
self._camera_tool = None
|
||||
self.setDuration(500)
|
||||
self.setEasingCurve(QEasingCurve.InOutQuad)
|
||||
self.valueChanged.connect(self._onValueChanged)
|
||||
|
||||
def setCameraTool(self, camera_tool):
|
||||
self._camera_tool = camera_tool
|
||||
|
@ -26,10 +24,5 @@ class CameraAnimation(QVariantAnimation):
|
|||
def setTarget(self, target):
|
||||
self.setEndValue(QVector3D(target.x, target.y, target.z))
|
||||
|
||||
# def updateCurrentValue(self, value):
|
||||
# Logger.log("d", " ### value: %s" % str(value))
|
||||
# self._camera_tool.setOrigin(Vector(value.x(), value.y(), value.z()))
|
||||
|
||||
def _onValueChanged(self, value):
|
||||
Logger.log("d", " _onValueChanged value: %s" % str(value))
|
||||
def updateCurrentValue(self, value):
|
||||
self._camera_tool.setOrigin(Vector(value.x(), value.y(), value.z()))
|
||||
|
|
|
@ -1230,3 +1230,15 @@ class CuraApplication(QtApplication):
|
|||
|
||||
def addNonSliceableExtension(self, extension):
|
||||
self._non_sliceable_extensions.append(extension)
|
||||
|
||||
|
||||
@pyqtSlot("QVector3D")
|
||||
def testQVector3D(self, vect):
|
||||
Logger.log("d", "got QVector3D: %s : %s %s %s" % (vect, vect.x(), vect.y(), vect.z()))
|
||||
|
||||
@pyqtProperty("QVector3D")
|
||||
def getQVector3D(self):
|
||||
from PyQt5.QtGui import QVector3D
|
||||
vect = QVector3D(1.0, 2.0, 3.0)
|
||||
Logger.log("d", "get QVector3D: %s" % vect)
|
||||
return vect
|
||||
|
|
|
@ -306,6 +306,16 @@ Item
|
|||
}
|
||||
text: catalog.i18nc("@label", "Show Infill")
|
||||
}
|
||||
CheckBox {
|
||||
checked: true
|
||||
onClicked: {
|
||||
CuraApplication.log("getting QVector3D");
|
||||
var v = CuraApplication.getQVector3D;
|
||||
CuraApplication.log("getting QVector3D");
|
||||
CuraApplication.testQVector3D(v);
|
||||
}
|
||||
text: catalog.i18nc("@label", "test")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue