tetrixwindow.js Example File

script/qstetrix/tetrixwindow.js
function TetrixWindow(ui)
{
    this.ui = ui;

    var boardUi = ui.findChild("board");
    boardUi.nextPieceLabel = ui.findChild("nextPieceLabel");

    this.board = new TetrixBoard(boardUi);

    ui.findChild("startButton").clicked.connect(this.board, this.board.start);
    ui.findChild("quitButton").clicked.connect(Qt.App.quit);
    ui.findChild("pauseButton").clicked.connect(this.board, this.board.pause);
    boardUi.scoreChanged.connect(ui.findChild("scoreLcd")["display(int)"]);
    boardUi.levelChanged.connect(ui.findChild("levelLcd")["display(int)"]);
    boardUi.linesRemovedChanged.connect(ui.findChild("linesLcd")["display(int)"]);
}

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.