VisualEffect.qml 627 B

1234567891011121314151617181920212223242526
  1. import QtQuick 2.5
  2. import ".."
  3. Item {
  4. id: root
  5. property alias target: effectSource.sourceItem
  6. property string effect: "Random"
  7. property var effectObject
  8. function scheduleUpdate() { effectSource.scheduleUpdate() }
  9. anchors.fill: target
  10. ShaderEffectSource {
  11. id: effectSource
  12. smooth: true
  13. hideSource: true
  14. sourceItem: target
  15. live: false
  16. }
  17. Component.onCompleted: {
  18. effectObject = Effects.getComponent(effect).createObject(root, { "source": effectSource, "anchors.fill": root, "targetWidth": root.width, "targetHeight": root.height })
  19. }
  20. }