VisualEffect.qml 542 B

1234567891011121314151617181920212223
  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. anchors.fill: target
  9. ShaderEffectSource {
  10. id: effectSource
  11. smooth: true
  12. hideSource: true
  13. sourceItem: target
  14. }
  15. Component.onCompleted: {
  16. effectObject = Effects.getComponent(effect).createObject(root, { "source": effectSource, "anchors.fill": root, "targetWidth": root.width, "targetHeight": root.height })
  17. }
  18. }