Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于数字仪表板的Qt-QML_Qt_Opengl_Qml_Dashboard - Fatal编程技术网

用于数字仪表板的Qt-QML

用于数字仪表板的Qt-QML,qt,opengl,qml,dashboard,Qt,Opengl,Qml,Dashboard,我试图在Qt-QML中开发一个由 速度表和转速表各一个指针。 当我参与旋转时,这个设计的问题就出现了 针:在这种情况下,它有一个急促的运动,它不是 非常流利。 例如,假设速度为0 km/h,即针位于 0度,然后我想显示100公里/小时,位于90度,这个 打捆针到达这个角度时会有一系列快速的抽搐,而不是作为一个动作 独特流畅的动作。 有人有办法解决这个麻烦吗?我应该这样做吗 使用openGL direction: RotationAnimation.Shortest; 我报告下面的代码(我使用

我试图在Qt-QML中开发一个由 速度表和转速表各一个指针。 当我参与旋转时,这个设计的问题就出现了 针:在这种情况下,它有一个急促的运动,它不是 非常流利。 例如,假设速度为0 km/h,即针位于 0度,然后我想显示100公里/小时,位于90度,这个 打捆针到达这个角度时会有一系列快速的抽搐,而不是作为一个动作 独特流畅的动作。 有人有办法解决这个麻烦吗?我应该这样做吗 使用openGL

 direction: RotationAnimation.Shortest;
我报告下面的代码(我使用了QML旋转函数,但它 (这还不够)

 direction: RotationAnimation.Shortest;
我今天学的

 direction: RotationAnimation.Shortest;
尝试使用SmoothDanimation,将实现您想要的目标,因为SmoothDanimation是为下一个paint()计算当前位置,而不是初始位置

Image {
    id: needle
    source: "../../images/needle.png"
    antialiasing: true
    transform: Rotation {
    id: needleRotation
    origin.x: 80;
    origin.y: 80;
    angle: 0
    Behavior on angle {
        SmoothedAnimation {
            id: needleRotationAnimation
            easing.type: Easing.InOutCubic;
            duration: 20;
        }
    }
}
 direction: RotationAnimation.Shortest;
我想了解更多关于你的应用程序的信息,因为它可能对你来说真的很有必要

 direction: RotationAnimation.Shortest;

如果有必要的话,告诉我,我会试着再看一看

20毫秒对于动画来说似乎很短,尤其是对于InOutCubic。对于这种快速过渡,请使用线性缓和进行测试。
 direction: RotationAnimation.Shortest;