QML on QGraphicsView is limited to only features that are fast enough and absolutely necessary to make nice UIs. Potentially slow features like composition modes, QPainterPaths, QGraphicsEffects and complex brushes are not supported. We have been trying to make it easy for you to create fast and responsive UIs, and hard to create sluggish ones.
However, we are working on a new scene graphbasedbackendfor QML using OpenGL, and certain things that were too slow on QGraphicsView are now possible on scene graph thanks to hardware acceleration. For instance, the filters implemented by QGraphicsEffects (blur, colourize, drop shadow and group opacity) could now be implemented with fragment shaders. Page curl and genie effects could be implemented with vertex shaders. After tediously implementing some shader effects in C++, we were inspired by Qt/3D and added a new QML item, the ShaderEffectItem, which made implementing shader effects a whole lot easier.
The ShaderEffectItem is simply a rectangle with a custom vertex and fragment shader. The vertices passed to the vertex shader are the corners of the rectangle defined by the "width" and "height" properties of the item. (There is a property you can set to divide the rectangle into multiple rows and columns, but by default, you get four vertices.) The nifty thing about the ShaderEffectItem, though, is that you can define your own properties on the QML item, and they will be available to you as uniform variables in the shaders. For instance, you can define a property called "tint" of type "color" and animate it in QML, and you can read it in the shaders as "uniform vec4 tint". Several types are supported: real, point, size, color, vector3d, and a new type, ShaderEffectSource, which maps to a "sampler2D" in the shader code. The ShaderEffectSource allows you to render a QML item into a texture and pass it to the ShaderEffectItem. The ShaderEffectSource has properties like wrap mode and mipmapping, and a reference to the QML item to render into the texture. ShaderEffectItems can be strung together by letting one ShaderEffectItem be the source of another. The ShaderEffectItem is powerful, and as with anything powerful, you need to use it with caution. A poorly written shader or too many effects active at once can easily ruin the performance, well, on devices at least.
The code below shows how the wobble effect can be implemented.