Animation in QML-Sine wave



  • Hello everyone,
    I am working on QtQuick 1.0. How can i animate a sine waveform that is moving from one end of the screen to the other end.Its an urgent requirement and i would be thankful if anyone has an idea on how to do this.

    Thanks in Advance:)



  • If you know painting with Qt very well, you can implement your custom QML component (with QDeclarativeItem http://developer.qt.nokia.com/doc/qt-4.8/qdeclarativeitem.html).

    It is not that easy but works well. You can give it a property (that can be for example called "time") that controls the animation and then, use an Animation component in QML to animate it.



  • Thanks for the reply,
    Can't we use ShaderEffectSource of Qt Quick2.0. Is it useful working on the pixels to show the effect of sinusoidal wave or any other solution?
    I m not much familiar with painting in Qt and now i have to learn and do it. If it is only the solution i have to....help me in tracing all the possibilities regarding do it?

    Thanks in Advance



  • Hello,

    there is ShaderEffectSource for Qt Quick 1.0. See http://labs.qt.nokia.com/2011/05/03/qml-shadereffectitem-on-qgraphicsview/**



  • Hello,
    Thank you.........
    I had worked on the Qt Quick 1.0 using "import Qt.labs.shaders 1.0"
    it is showing an error...........ShaderEffectItem::paint - OpenGL not available
    Can anyone suggest a solution for this?

    Thanks in Advance:)



  • Hi,

    You should add -opengl option to qmlviewer if your project is Qt Quick UI.
    If you use Qt Quick Application, set the QDeclarativeView’s viewport to be a QGLWidget and set the viewport update mode to FullViewportUpdate.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.