doc/src/snippets/qtscript/scriptedslot/object.js
changeset 0 1918ee327afb
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 function Object(timer, editor)
       
     2 {
       
     3     this.editor = editor;
       
     4     this.counter = 0;
       
     5     timer.timeout.connect(notify);
       
     6     timer.timeout.connect(this, this.addLine);
       
     7 }
       
     8 
       
     9 Object.prototype.addLine = function()
       
    10 {
       
    11     this.editor.append(this.counter);
       
    12     this.counter += 1;
       
    13 }
       
    14 
       
    15 function notify()
       
    16 {
       
    17     print("timeout() received");
       
    18 }