mirror of
git://projects.qi-hardware.com/openwrt-packages.git
synced 2024-12-22 14:36:26 +02:00
Tile: the 15 Puzzle game written in Qt4
This was my first real try for Qt (and C++, too). Don't beat me hard :)
This commit is contained in:
parent
9186e374b2
commit
bd53759d02
43
Tile/Makefile
Normal file
43
Tile/Makefile
Normal file
@ -0,0 +1,43 @@
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=Tile
|
||||
PKG_VERSION:=20110114
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
PKG_UNPACK:=$(CP) ./src/{tile.*,main.cpp,Tile.pro} $(PKG_BUILD_DIR)
|
||||
|
||||
$(call include_mk,qmake.mk)
|
||||
|
||||
define Package/Tile
|
||||
SECTION:=games
|
||||
CATEGORY:=Games
|
||||
TITLE:=15 Puzzle game, written in Qt
|
||||
DEPENDS:=+qt4 +qt4-gui +dejavu-fonts-ttf
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
(\
|
||||
cd $(PKG_BUILD_DIR); \
|
||||
echo "QMAKE_LIBS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib" >> Tile.pro; \
|
||||
echo "INCLUDEPATH += $(STAGING_DIR)/usr/include/QtGui" >> Tile.pro; \
|
||||
echo "INCLUDEPATH += $(STAGING_DIR)/usr/include/QtCore" >> Tile.pro; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Qmake,Tile)
|
||||
endef
|
||||
|
||||
define Package/Tile/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/Tile $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,Tile))
|
9
Tile/src/Tile.pro
Normal file
9
Tile/src/Tile.pro
Normal file
@ -0,0 +1,9 @@
|
||||
# -------------------------------------------------
|
||||
# Project created by QtCreator 2011-01-13T20:55:49
|
||||
# -------------------------------------------------
|
||||
TARGET = Tile
|
||||
TEMPLATE = app
|
||||
SOURCES += main.cpp \
|
||||
tile.cpp
|
||||
HEADERS += tile.h
|
||||
FORMS += tile.ui
|
18
Tile/src/main.cpp
Normal file
18
Tile/src/main.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <QtGui/QApplication>
|
||||
#include "tile.h"
|
||||
|
||||
|
||||
#if defined(Q_WS_QWS)
|
||||
#include <QtGui/QWSServer>
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
Tile w;
|
||||
#if defined(Q_WS_QWS)
|
||||
QWSServer::setCursorVisible(false);
|
||||
#endif
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
354
Tile/src/tile.cpp
Normal file
354
Tile/src/tile.cpp
Normal file
@ -0,0 +1,354 @@
|
||||
#include "tile.h"
|
||||
#include "ui_tile.h"
|
||||
|
||||
Tile::Tile(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::Tile)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->pushButton_16->hide();
|
||||
ui->pushButton->setProperty("id","1");
|
||||
ui->pushButton_2->setProperty("id","2");
|
||||
ui->pushButton_3->setProperty("id","3");
|
||||
ui->pushButton_4->setProperty("id","4");
|
||||
ui->pushButton_5->setProperty("id","5");
|
||||
ui->pushButton_6->setProperty("id","6");
|
||||
ui->pushButton_7->setProperty("id","7");
|
||||
ui->pushButton_8->setProperty("id","8");
|
||||
ui->pushButton_9->setProperty("id","9");
|
||||
ui->pushButton_10->setProperty("id","10");
|
||||
ui->pushButton_11->setProperty("id","11");
|
||||
ui->pushButton_12->setProperty("id","12");
|
||||
ui->pushButton_13->setProperty("id","13");
|
||||
ui->pushButton_14->setProperty("id","14");
|
||||
ui->pushButton_15->setProperty("id","15");
|
||||
ui->pushButton_16->setProperty("id","16");
|
||||
/*ui->pushButton_Reset->setProperty("id","Reset");
|
||||
ui->pushButton_Shuffle->setProperty("id","Shuffle");
|
||||
ui->pushButton_Help->setProperty("id","Help");
|
||||
ui->pushButton_Quit->setProperty("id","Quit");*/
|
||||
/*
|
||||
ui->pushButton->setAccessibleDescription("1");
|
||||
ui->pushButton_2->setAccessibleDescription("2");
|
||||
ui->pushButton_3->setAccessibleDescription("3");
|
||||
ui->pushButton_4->setAccessibleDescription("4");
|
||||
ui->pushButton_5->setAccessibleDescription("5");
|
||||
ui->pushButton_6->setAccessibleDescription("6");
|
||||
ui->pushButton_7->setAccessibleDescription("7");
|
||||
ui->pushButton_8->setAccessibleDescription("8");
|
||||
ui->pushButton_9->setAccessibleDescription("9");
|
||||
ui->pushButton_10->setAccessibleDescription("10");
|
||||
ui->pushButton_11->setAccessibleDescription("11");
|
||||
ui->pushButton_12->setAccessibleDescription("12");
|
||||
ui->pushButton_13->setAccessibleDescription("13");
|
||||
ui->pushButton_14->setAccessibleDescription("14");
|
||||
ui->pushButton_15->setAccessibleDescription("15");
|
||||
ui->pushButton_16->setAccessibleDescription("16");
|
||||
*/
|
||||
// Create seed for the random
|
||||
// That is needed only once on application startup
|
||||
QTime time = QTime::currentTime();
|
||||
qsrand((uint)time.msec());
|
||||
|
||||
qApp->installEventFilter(this);
|
||||
//ui->pushButton->installEventFilter(this);
|
||||
}
|
||||
|
||||
Tile::~Tile()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void Tile::changeEvent(QEvent *e)
|
||||
{
|
||||
QMainWindow::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Tile::checkNeighbours()
|
||||
{
|
||||
QPushButton *button = qobject_cast< QPushButton* >(QObject::sender());
|
||||
//int id = button->accessibleDescription().toInt();
|
||||
int id = button->property("id").toInt();
|
||||
//check button to the right
|
||||
if (id != 16 && id != 12 && id != 8 && id != 4) {
|
||||
QPushButton *button_neighbour = idtoButton(id+1);
|
||||
if (button_neighbour->text() == "16" && button_neighbour->isHidden()) {
|
||||
swapButtons(button, button_neighbour);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//check button to the left
|
||||
if (id != 13 && id != 9 && id != 5 && id != 1) {
|
||||
QPushButton *button_neighbour = idtoButton(id-1);
|
||||
if (button_neighbour->text() == "16" && button_neighbour->isHidden()) {
|
||||
swapButtons(button, button_neighbour);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//check button to the bottom
|
||||
if (id != 16 && id != 15 && id != 14 && id != 13) {
|
||||
QPushButton *button_neighbour = idtoButton(id+4);
|
||||
if (button_neighbour->text() == "16" && button_neighbour->isHidden()) {
|
||||
swapButtons(button, button_neighbour);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//check button to the up
|
||||
if (id != 4 && id != 3 && id != 2 && id != 1) {
|
||||
QPushButton *button_neighbour = idtoButton(id-4);
|
||||
if (button_neighbour->text() == "16" && button_neighbour->isHidden()) {
|
||||
swapButtons(button, button_neighbour);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//qDebug() << "No swap candidates...";
|
||||
return;
|
||||
}
|
||||
|
||||
QPushButton* Tile::idtoButton(int id)
|
||||
{
|
||||
switch (id) {
|
||||
case 1:
|
||||
return ui->pushButton;
|
||||
case 2:
|
||||
return ui->pushButton_2;
|
||||
case 3:
|
||||
return ui->pushButton_3;
|
||||
case 4:
|
||||
return ui->pushButton_4;
|
||||
case 5:
|
||||
return ui->pushButton_5;
|
||||
case 6:
|
||||
return ui->pushButton_6;
|
||||
case 7:
|
||||
return ui->pushButton_7;
|
||||
case 8:
|
||||
return ui->pushButton_8;
|
||||
case 9:
|
||||
return ui->pushButton_9;
|
||||
case 10:
|
||||
return ui->pushButton_10;
|
||||
case 11:
|
||||
return ui->pushButton_11;
|
||||
case 12:
|
||||
return ui->pushButton_12;
|
||||
case 13:
|
||||
return ui->pushButton_13;
|
||||
case 14:
|
||||
return ui->pushButton_14;
|
||||
case 15:
|
||||
return ui->pushButton_15;
|
||||
case 16:
|
||||
return ui->pushButton_16;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Tile::swapButtons(QPushButton *button, QPushButton *button_neighbour) {
|
||||
button->hide();
|
||||
button_neighbour->setText(button->text());
|
||||
button->setText("16");
|
||||
button_neighbour->show();
|
||||
button_neighbour->setFocus();
|
||||
}
|
||||
|
||||
void Tile::Reset()
|
||||
{
|
||||
for (int i = 1; i < 16; i++) {
|
||||
QPushButton *button = idtoButton(i);
|
||||
QString str;
|
||||
button->show();
|
||||
button->setText(str.setNum(i));
|
||||
}
|
||||
QPushButton *button = idtoButton(16);
|
||||
button->hide();
|
||||
button->setText("16");
|
||||
}
|
||||
|
||||
void Tile::Quit()
|
||||
{
|
||||
switch (QMessageBox::information(this,
|
||||
"Confirm Quit",
|
||||
"Are you sure to quit?",
|
||||
"&Quit","&Cancel"))
|
||||
{
|
||||
case 0:
|
||||
qApp->quit();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Tile::Shuffle()
|
||||
{
|
||||
Reset();
|
||||
for (int i = 1; i < 16; i++) {
|
||||
//get random number 1..15
|
||||
int id = randInt(1,15);
|
||||
//swap it
|
||||
QPushButton *button_1 = idtoButton(i);
|
||||
QPushButton *button_2 = idtoButton(id);
|
||||
QString str = button_1->text();
|
||||
button_1->setText(button_2->text());
|
||||
button_2->setText(str);
|
||||
}
|
||||
if (!isSolvable()) {
|
||||
Shuffle();
|
||||
}
|
||||
}
|
||||
|
||||
int Tile::randInt(int low, int high)
|
||||
{
|
||||
// Random number between low and high
|
||||
return qrand() % ((high + 1) - low) + low;
|
||||
}
|
||||
|
||||
bool Tile::isSolvable()
|
||||
{
|
||||
//http://mathworld.wolfram.com/15Puzzle.html
|
||||
//accumulator
|
||||
int acc = 0;
|
||||
//iterate through all tiles
|
||||
for (int i = 1; i < 17; i++) {
|
||||
//get button from id
|
||||
QPushButton *button = idtoButton(i);
|
||||
//get the number on tile
|
||||
int num = button->text().toInt();
|
||||
if (num == 16) {
|
||||
//get row of empty tile
|
||||
if (i < 5) {
|
||||
acc = acc + 1;
|
||||
} else if (i < 9) {
|
||||
acc = acc + 2;
|
||||
} else if (i < 13) {
|
||||
acc = acc + 3;
|
||||
} else {
|
||||
acc = acc + 4;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
//iterate though the rest of tiles
|
||||
for (int j = i+1; j < 17; j++) {
|
||||
//get next button
|
||||
QPushButton *button_next = idtoButton(j);
|
||||
//get the number of next tile
|
||||
int num_next = button_next->text().toInt();
|
||||
//compare and increment accumulator
|
||||
if (num_next < num) {
|
||||
acc++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//qDebug() << acc;
|
||||
if (acc%2 == 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Tile::Help()
|
||||
{
|
||||
QMessageBox::about(this,
|
||||
"15 Puzzle",
|
||||
"\
|
||||
This is the famous 15 Puzzle game.\n\
|
||||
The object of the puzzle is to place the\n\
|
||||
tiles in order by making sliding moves\n\
|
||||
that use the empty space.\n\
|
||||
\n\
|
||||
\"Reset\" (Alt+R): reset the puzzle to solved position\n\
|
||||
\"Shuffle\" (Alt+S): shuffle the puzzle. Note that this\n\
|
||||
always produces solvable positions, don\'t give up\n\
|
||||
\"Help\" (Alt+H): show this help\n\
|
||||
\"Quit\" (Alt+Q): quit the app");
|
||||
}
|
||||
|
||||
void Tile::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Escape || event->key() == Qt::Key_Q) {
|
||||
Quit();
|
||||
} else if (event->key() == Qt::Key_Up) {
|
||||
//focusNextChild();
|
||||
//qDebug() << qApp->focusWidget();
|
||||
QPushButton *button = qobject_cast< QPushButton* >(qApp->focusWidget());
|
||||
keyUp(button);
|
||||
} else if (event->key() == Qt::Key_Down) {
|
||||
//focusPreviousChild();
|
||||
//qDebug() << qApp->focusWidget();
|
||||
QPushButton *button = qobject_cast< QPushButton* >(qApp->focusWidget());
|
||||
keyDown(button);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool Tile::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
QKeyEvent *keyEvent = NULL;//event data, if this is a keystroke event
|
||||
bool result = false;//return true to consume the keystroke
|
||||
|
||||
if (event->type() == QEvent::KeyPress)
|
||||
{
|
||||
keyEvent = dynamic_cast<QKeyEvent*>(event);
|
||||
//override Key Up and Key Down only
|
||||
if (keyEvent->key() == Qt::Key_Up || keyEvent->key() == Qt::Key_Down) {
|
||||
this->keyPressEvent(keyEvent);
|
||||
result = true;
|
||||
} else {
|
||||
result = QObject::eventFilter(obj, event);
|
||||
}
|
||||
}//if type()
|
||||
|
||||
/*else if (event->type() == QEvent::KeyRelease)
|
||||
{
|
||||
keyEvent = dynamic_cast<QKeyEvent*>(event);
|
||||
this->keyReleaseEvent(keyEvent);
|
||||
result = true;
|
||||
}*///else if type()
|
||||
|
||||
//### Standard event processing ###
|
||||
else
|
||||
result = QObject::eventFilter(obj, event);
|
||||
|
||||
return result;
|
||||
}//eventFilter
|
||||
|
||||
void Tile::keyUp(QPushButton *button) {
|
||||
int id = button->property("id").toInt();
|
||||
QPushButton *button_up;
|
||||
if (id < 5) {
|
||||
button_up = idtoButton(id+12);
|
||||
} else {
|
||||
button_up = idtoButton(id-4);
|
||||
}
|
||||
if (button_up->isHidden()) {
|
||||
keyUp(button_up);
|
||||
} else {
|
||||
button_up->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void Tile::keyDown(QPushButton *button) {
|
||||
int id = button->property("id").toInt();
|
||||
QPushButton *button_down;
|
||||
if (id > 12) {
|
||||
button_down = idtoButton(id-12);
|
||||
} else {
|
||||
button_down = idtoButton(id+4);
|
||||
}
|
||||
if (button_down->isHidden()) {
|
||||
keyDown(button_down);
|
||||
} else {
|
||||
button_down->setFocus();
|
||||
}
|
||||
}
|
43
Tile/src/tile.h
Normal file
43
Tile/src/tile.h
Normal file
@ -0,0 +1,43 @@
|
||||
#ifndef TILE_H
|
||||
#define TILE_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QDebug>
|
||||
#include <QPushButton>
|
||||
#include <QTime>
|
||||
#include <QMessageBox>
|
||||
#include <QKeyEvent>
|
||||
|
||||
namespace Ui {
|
||||
class Tile;
|
||||
}
|
||||
|
||||
class Tile : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
Tile(QWidget *parent = 0);
|
||||
~Tile();
|
||||
|
||||
public slots:
|
||||
void checkNeighbours();
|
||||
QPushButton* idtoButton(int id);
|
||||
void swapButtons(QPushButton *button, QPushButton *button_neighbour);
|
||||
void Reset();
|
||||
void Quit();
|
||||
void Shuffle();
|
||||
int randInt(int low, int high);
|
||||
bool isSolvable();
|
||||
void Help();
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
void keyUp(QPushButton *button);
|
||||
void keyDown(QPushButton *button);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui::Tile *ui;
|
||||
};
|
||||
|
||||
#endif // TILE_H
|
765
Tile/src/tile.ui
Normal file
765
Tile/src/tile.ui
Normal file
@ -0,0 +1,765 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Tile</class>
|
||||
<widget class="QMainWindow" name="Tile">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>320</width>
|
||||
<height>240</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Tile</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777213</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>0</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>0</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>3</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>0</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>4</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>60</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>5</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>60</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>6</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>60</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>7</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_8">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>60</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>8</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_9">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>120</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>9</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_10">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>120</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_11">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>120</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>11</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_12">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>120</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>12</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_13">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>180</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>13</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_14">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>180</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>14</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_15">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>180</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>15</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_16">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>180</y>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>DejaVu Sans</family>
|
||||
<pointsize>28</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>16</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Reset">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>255</x>
|
||||
<y>20</y>
|
||||
<width>60</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Shuffle">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>255</x>
|
||||
<y>80</y>
|
||||
<width>60</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Shuffle</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Quit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>255</x>
|
||||
<y>200</y>
|
||||
<width>60</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Quit</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_Help">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>255</x>
|
||||
<y>140</y>
|
||||
<width>60</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>240</x>
|
||||
<y>0</y>
|
||||
<width>20</width>
|
||||
<height>240</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<tabstops>
|
||||
<tabstop>pushButton</tabstop>
|
||||
<tabstop>pushButton_2</tabstop>
|
||||
<tabstop>pushButton_3</tabstop>
|
||||
<tabstop>pushButton_4</tabstop>
|
||||
<tabstop>pushButton_Reset</tabstop>
|
||||
<tabstop>pushButton_5</tabstop>
|
||||
<tabstop>pushButton_6</tabstop>
|
||||
<tabstop>pushButton_7</tabstop>
|
||||
<tabstop>pushButton_8</tabstop>
|
||||
<tabstop>pushButton_Shuffle</tabstop>
|
||||
<tabstop>pushButton_9</tabstop>
|
||||
<tabstop>pushButton_10</tabstop>
|
||||
<tabstop>pushButton_11</tabstop>
|
||||
<tabstop>pushButton_12</tabstop>
|
||||
<tabstop>pushButton_Help</tabstop>
|
||||
<tabstop>pushButton_13</tabstop>
|
||||
<tabstop>pushButton_14</tabstop>
|
||||
<tabstop>pushButton_15</tabstop>
|
||||
<tabstop>pushButton_16</tabstop>
|
||||
<tabstop>pushButton_Quit</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>pushButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>40</x>
|
||||
<y>23</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>373</x>
|
||||
<y>34</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_2</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>109</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>343</x>
|
||||
<y>47</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_3</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>156</x>
|
||||
<y>15</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>371</x>
|
||||
<y>19</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_4</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>236</x>
|
||||
<y>21</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>357</x>
|
||||
<y>29</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_5</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>46</x>
|
||||
<y>100</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>340</x>
|
||||
<y>91</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_6</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>116</x>
|
||||
<y>75</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>369</x>
|
||||
<y>136</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_7</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>165</x>
|
||||
<y>71</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>356</x>
|
||||
<y>81</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_8</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>239</x>
|
||||
<y>110</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>396</x>
|
||||
<y>107</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_9</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>38</x>
|
||||
<y>158</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>355</x>
|
||||
<y>149</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_10</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>103</x>
|
||||
<y>139</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>395</x>
|
||||
<y>160</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_11</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>179</x>
|
||||
<y>168</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>376</x>
|
||||
<y>180</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_12</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>239</x>
|
||||
<y>174</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>414</x>
|
||||
<y>201</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_13</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>48</x>
|
||||
<y>211</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>344</x>
|
||||
<y>218</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_14</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>102</x>
|
||||
<y>200</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>335</x>
|
||||
<y>211</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_15</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>161</x>
|
||||
<y>194</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>360</x>
|
||||
<y>188</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_16</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>225</x>
|
||||
<y>229</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>387</x>
|
||||
<y>234</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_Reset</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>Reset()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>284</x>
|
||||
<y>31</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>288</x>
|
||||
<y>59</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_Quit</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>Quit()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>273</x>
|
||||
<y>211</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>287</x>
|
||||
<y>120</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_Shuffle</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>Shuffle()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>278</x>
|
||||
<y>90</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>267</x>
|
||||
<y>121</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>pushButton_Help</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>Tile</receiver>
|
||||
<slot>Help()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>290</x>
|
||||
<y>148</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>292</x>
|
||||
<y>178</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>checkNeighbours()</slot>
|
||||
<slot>Reset()</slot>
|
||||
<slot>Quit()</slot>
|
||||
<slot>Shuffle()</slot>
|
||||
<slot>Help()</slot>
|
||||
</slots>
|
||||
</ui>
|
Loading…
Reference in New Issue
Block a user