February 20, 2012

Harry443 Harry443
Lab Rat
24 posts

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:)

5 replies

February 20, 2012

Sfiet_Konstantin Sfiet_Konsta..
Ant Farmer
33 posts

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.

February 21, 2012

Harry443 Harry443
Lab Rat
24 posts

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

February 21, 2012

task_struct task_struct
Hobby Entomologist
344 posts

Hello,

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

 Signature 

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.”
- Linus Torvalds

February 22, 2012

Harry443 Harry443
Lab Rat
24 posts

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:)

February 22, 2012

task_struct task_struct
Hobby Entomologist
344 posts

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.

 Signature 

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.”
- Linus Torvalds

 
  ‹‹ How to set path to Memory card in qt?      Repeater::itemAt access to non-Item properties ››

You must log in to post a reply. Not a member yet? Register here!