Aber das Problem mit dem Zeigerruckler ist immer noch da
Würde mich auf Hinweise oder Tipps freuen, was die Ursache sein könnte.
Danke!
Gruss
Flat
Code: Alles auswählen
Item {
id: root
property int value : 0
property int angle : 0
width: 338
height: 518
Image {
id: zeiger
x: 167; y: 114
width: 11
height: 190
smooth: true
source: "GeschwZeiger.png"
transform: Rotation {
id: zeigerRotation
origin.x: 0; origin.y: 150
//! [needle angle]
angle: Math.min(Math.max(root.value * 3.5 -160 ), root.value +50)
Behavior on angle {
SpringAnimation {
spring: 0.1
damping: .25
}
}
//! [needle angle]
}
}
}
Code: Alles auswählen
Item {
id: root
property int value : 0
property int angle : 0
property in a: 550
property in b: 366
width: 338
height: 518
Image {
id: zeiger
x: 167; y: 114
width: 366
height: Math.sqrt((root.b*root.b) + (Math.cos(tachoZeigerRotation.angle) * ((root.a*root.a)-(root.b*root.b))))
source: "GeschwZeiger.png"
transform: Rotation {
id: zeigerRotation
origin.x: 183; origin.y: 1
//! [needle angle]
angle: Math.min(Math.max(root.value * 3.5 -160 ), root.value +50)
Behavior on angle {
SpringAnimation {
spring: 0.1
damping: .25
}
}
//! [needle angle]
}
}
}
Code: Alles auswählen
Image {
id: tachoZeiger
x: 0
y: 275-tachoZeiger.height/2
width: 366
height: Math.sqrt(c+ (Math.pow(Math.cos(tachoZeigerRotation.angle.toFixed(1)*Math.PI/180),2)*e))
source: "zeiger480x480.png"
smooth: true
transform: Rotation {
id: tachoZeigerRotation
origin.x: 183; origin.y: tachoZeiger.height/2
angle: Math.min(Math.max( root.value*3.5 -160 ), 160)
Behavior on angle {
SpringAnimation{
spring: 0.03
damping: .1
}
}
}
}
Code: Alles auswählen
Text {
id: myText1
x: 156
y: 144
text: tachoZeigerRotation.angle.toFixed(0)
anchors.verticalCenterOffset: -97
anchors.horizontalCenterOffset: -8
anchors.centerIn: parent
style: Text.Outline
font.italic: true
font.bold: true
rotation: 0
font.family: "Arial Black"
font.pointSize: 35
color: "red"
}
Code: Alles auswählen
Image {
id: tachoZeiger
x: 178
y: 270
width: 11
height: Math.sqrt(c+ (Math.pow(Math.cos(tachoZeigerRotation.angle.toFixed(1)*Math.PI/180),2)*e))
source: "GeschwZeiger.png"
smooth: true
transform: Rotation {
id: tachoZeigerRotation
origin.x: 5.5; origin.y: 1;
angle: 25.714+root.value*9/7
Behavior on angle {
SpringAnimation{
spring: 0.3
damping: 0.1
}
}
}
}