1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2025-04-21 12:27:27 +03: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:
kyak
2011-01-14 16:30:00 +03:00
parent 9186e374b2
commit bd53759d02
6 changed files with 1232 additions and 0 deletions

43
Tile/src/tile.h Normal file
View 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