The ShaderEffectSource object encapsulates the source content for the ShaderEffectItem. More...
ShaderEffectSource is available in the Qt.labs.shaders 1.0 module. Elements in the Qt.labs module are not guaranteed to remain compatible in future versions.
This element provides preliminary support for OpenGL shaders in QML, and may be heavily changed or removed in later versions.
Requirement for the ability to use of shaders is that the application is either using opengl graphicssystem or has set QGLWidget as the viewport to QDeclarativeView (recommended way).
ShaderEffectSource object encapsulates the source content so that it can be utilized in ShaderEffectItem. Source content can be a live QML object tree, or a snapshot of QML object tree.
hideSource : bool |
This property holds the flag to define whether the original source item is hidden when the effect item is drawn.
The default value is false.
live : bool |
This property holds the optimization flag to define whether the source item content is changing or static.
If value true is assigned to this property, source item content is re-rendered into a texture for every frame. Setting the value to false improves the performance as it skips rendering the source item (and its chidleren) and instead immediately passes the previously rendered and cached texture to the shaders.
The default value is true.
sourceItem : Item |
This property holds the Item which is used as the source for the shader effect. If the item has children, those are included as well.
Note: When source item content is passed to the ShaderEffectItem(s), it is always clipped to the boundingrect of the sourceItem regardless of its clipping property.
sourceRect : QRectF |
This property can be used to specify margins for the source content.
If other value than Qt.rect(0,0,0,0) is assigned to this property, it is interpreted as specifying a relative source rectangle for the source content.
For example, setting Qt.rect(-10.0, -10.0, 120.0, 120.0) for a source that has width and height of 100 pixels would produce 10 pixels margins to each side of the source.
Margins are useful when the original content is wanted to be spread outside the original source area, like when creating a dropshadow with the shader or in other similar effects.
The default value is Qt.rect(0,0,0,0).
textureSize : QSize |
wrapMode : enumeration |
This property defines the wrap parameter for the source after it has been mapped as a texture.
The default value is ClampToEdge.
Repaints the source item content into the texture.
This method is useful when ShaderEffectSource::live has been set to false and the changes in the source item content is desired to be made visible for the shaders.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.