aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js
blob: 44ad0e657c2ffb7223b19e6f4b9fc0ffa8d32a1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function Object(timer, editor)
{
    this.editor = editor;
    this.counter = 0;
    timer.timeout.connect(notify);
    timer.timeout.connect(this, this.addLine);
}

Object.prototype.addLine = function()
{
    this.editor.append(this.counter);
    this.counter += 1;
}

function notify()
{
    print("timeout() received");
}