diff --git a/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py b/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
index ddb8a77f37..33e6ece843 100644
--- a/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
+++ b/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
@@ -227,6 +227,17 @@ class AttachmentEditorTaskPanel(FrozenClass):
self.form.setWindowIcon(QtGui.QIcon(':/icons/Part_Attachment.svg'))
self.form.setWindowTitle(_translate('AttachmentEditor',"Attachment",None))
+ self.form.attachmentOffsetX.setProperty("unit", "mm")
+ self.form.attachmentOffsetY.setProperty("unit", "mm")
+ self.form.attachmentOffsetZ.setProperty("unit", "mm")
+ Gui.ExpressionBinding(self.form.attachmentOffsetX).bind(self.obj,"AttachmentOffset.Base.x")
+ Gui.ExpressionBinding(self.form.attachmentOffsetY).bind(self.obj,"AttachmentOffset.Base.y")
+ Gui.ExpressionBinding(self.form.attachmentOffsetZ).bind(self.obj,"AttachmentOffset.Base.z")
+
+ Gui.ExpressionBinding(self.form.attachmentOffsetYaw).bind(self.obj,"AttachmentOffset.Rotation.Yaw")
+ Gui.ExpressionBinding(self.form.attachmentOffsetPitch).bind(self.obj,"AttachmentOffset.Rotation.Pitch")
+ Gui.ExpressionBinding(self.form.attachmentOffsetRoll).bind(self.obj,"AttachmentOffset.Rotation.Roll")
+
self.refLines = [self.form.lineRef1,
self.form.lineRef2,
self.form.lineRef3,
@@ -437,12 +448,12 @@ class AttachmentEditorTaskPanel(FrozenClass):
try:
old_selfblock = self.block
self.block = True
- self.form.attachmentOffsetX.setText ((plm.Base.x * mm).UserString)
- self.form.attachmentOffsetY.setText ((plm.Base.y * mm).UserString)
- self.form.attachmentOffsetZ.setText ((plm.Base.z * mm).UserString)
- self.form.attachmentOffsetYaw.setText ((plm.Rotation.toEuler()[0] * deg).UserString)
- self.form.attachmentOffsetPitch.setText((plm.Rotation.toEuler()[1] * deg).UserString)
- self.form.attachmentOffsetRoll.setText ((plm.Rotation.toEuler()[2] * deg).UserString)
+ self.form.attachmentOffsetX.lineEdit().setText ((plm.Base.x * mm).UserString)
+ self.form.attachmentOffsetY.lineEdit().setText ((plm.Base.y * mm).UserString)
+ self.form.attachmentOffsetZ.lineEdit().setText ((plm.Base.z * mm).UserString)
+ self.form.attachmentOffsetYaw.lineEdit().setText ((plm.Rotation.toEuler()[0] * deg).UserString)
+ self.form.attachmentOffsetPitch.lineEdit().setText((plm.Rotation.toEuler()[1] * deg).UserString)
+ self.form.attachmentOffsetRoll.lineEdit().setText ((plm.Rotation.toEuler()[2] * deg).UserString)
self.form.checkBoxFlip.setChecked(self.attacher.Reverse)
diff --git a/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.ui b/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.ui
index 5dd8174005..f685fe6e7c 100644
--- a/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.ui
+++ b/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.ui
@@ -154,7 +154,7 @@
-
-
+
0
@@ -186,7 +186,7 @@
-
-
+
0
@@ -244,7 +244,7 @@
-
-
+
0
@@ -263,7 +263,7 @@
-
-
+
0
@@ -295,7 +295,7 @@ Note: The placement is expressed in local space of object being attached.
-
-
+
0
@@ -327,7 +327,7 @@ Note: The placement is expressed in local space of object being attached.
-
-
+
0
@@ -372,9 +372,9 @@ Note: The placement is expressed in local space of object being attached.
- Gui::InputField
- QLineEdit
-
+ Gui::QuantitySpinBox
+ QWidget
+