2011-01-14 15:30:00 +02:00
|
|
|
#ifndef TILE_H
|
|
|
|
#define TILE_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QTime>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
2011-01-14 18:24:57 +02:00
|
|
|
extern bool isRunning;
|
|
|
|
|
2011-01-14 15:30:00 +02:00
|
|
|
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);
|
2011-01-14 18:24:57 +02:00
|
|
|
bool isSolved();
|
2011-01-14 15:30:00 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void changeEvent(QEvent *e);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::Tile *ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TILE_H
|