Code:
import Qt 4.7
import "content"
import "content/Four_in_a_row.js" as Games
Rectangle {
id: game
property bool running: true
width: display.width; height: display.height + 10
Image {
id: boardImage
source: "content/pics/My_grid.png"
}
Column {
id: display
Grid {
id: board
width: boardImage.width; height: boardImage.height
columns: 3
Repeater {
model: 9
Four {
width: board.width/3
height: board.height/3
onClicked: {
if (game.running && Games.Play(index)) {
if (!Games.Move(index, "k"))
Games.computerTurn();
}
}
}
}
}
}
}