Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.81 KB | None | 0 0
  1. ////main.qml
  2. import QtQuick 2.4
  3.  
  4. Item {
  5.     id: root
  6.  
  7.     property real someProperty
  8.  
  9.     Inner {
  10.         //the existence of this property triggers the bug
  11.         property bool iDoAbsolutelyNothing
  12.  
  13.         Component.onCompleted: {
  14.             console.log("Changing someValue indirectly - this doesn't trigger the behavior");
  15.             root.someProperty = 1
  16.             console.log("Changing someValue directly - this triggers the behavior");
  17.             someValue = 2
  18.         }
  19.  
  20.         someValue: root.someProperty
  21.     }
  22. }
  23.  
  24. //// Inner.qml
  25. import QtQuick 2.4
  26.  
  27. Item {
  28.     property real someValue
  29.  
  30.     onSomeValueChanged: console.log("someValue changed to", someValue);
  31.     Behavior on someValue {
  32.         ScriptAction { script: { console.log("someValue Behavior triggered"); }}
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement