The main window of the game. More...
Public Slots | |
| void | play_game () |
| Received when the game begins. | |
| void | playDemo () |
| Received when the demo begins. | |
| void | showHelp () |
| Received when the help is requested. | |
| void | gameWon () |
| Received when the game is won. | |
| void | restart () |
| Received when the game restarts (either because it's being ended early, or because it's been won and the user wants to play again). | |
| void | timerEvent (QTimerEvent *event) |
| Makes kitten close or open its eyes. | |
Signals | |
| void | startDemo () |
| Sent when the demo should begin. | |
Public Member Functions | |
| RfkWindow () | |
| Constructs the window. | |
| RfkView * | view () |
| Returns our view, so that it can be manipulated by other classes. | |
Protected Member Functions | |
| void | keyPressEvent (QKeyEvent *event) |
| Called when the user presses a key. | |
Private Member Functions | |
| void | startBlinking () |
| Starts kitten blinking. | |
| void | stopBlinking () |
| Stops kitten blinking. | |
| QWidget * | prepare_front_screen () |
| Creates the front screen. | |
Private Attributes | |
| RfkView * | m_view |
| A view of the board. | |
| QLabel * | m_blink |
| Kitten's eyes, closed. | |
| int | m_blinkTimer |
| ID of the timer that makes kitten blink. | |
The main window of the game.
Contains the view.
Definition at line 10 of file RfkWindow.h.
| RfkWindow::RfkWindow | ( | ) |
Constructs the window.
Definition at line 12 of file RfkWindow.cpp.
References m_view, prepare_front_screen(), and restart().
| void RfkWindow::gameWon | ( | ) | [slot] |
Received when the game is won.
Definition at line 122 of file RfkWindow.cpp.
| void RfkWindow::keyPressEvent | ( | QKeyEvent * | event | ) | [protected] |
Called when the user presses a key.
| event | Details of the keypress. |
Definition at line 126 of file RfkWindow.cpp.
| void RfkWindow::play_game | ( | ) | [slot] |
Received when the game begins.
Definition at line 105 of file RfkWindow.cpp.
References stopBlinking().
Referenced by prepare_front_screen().
| void RfkWindow::playDemo | ( | ) | [slot] |
Received when the demo begins.
Definition at line 110 of file RfkWindow.cpp.
References startDemo(), and stopBlinking().
Referenced by prepare_front_screen().
| QWidget * RfkWindow::prepare_front_screen | ( | ) | [private] |
Creates the front screen.
This exists to simplify the constructor.
Definition at line 39 of file RfkWindow.cpp.
References ProportionalLayout::addItem(), m_blink, play_game(), playDemo(), showHelp(), and startBlinking().
Referenced by RfkWindow().
| void RfkWindow::restart | ( | ) | [slot] |
Received when the game restarts (either because it's being ended early, or because it's been won and the user wants to play again).
Definition at line 100 of file RfkWindow.cpp.
References startBlinking().
Referenced by RfkWindow().
| void RfkWindow::showHelp | ( | ) | [slot] |
Received when the help is requested.
Definition at line 116 of file RfkWindow.cpp.
Referenced by prepare_front_screen().
| void RfkWindow::startBlinking | ( | ) | [private] |
Starts kitten blinking.
Definition at line 132 of file RfkWindow.cpp.
References m_blinkTimer, and startTimer().
Referenced by prepare_front_screen(), and restart().
| void RfkWindow::startDemo | ( | ) | [signal] |
Sent when the demo should begin.
Definition at line 97 of file moc_RfkWindow.cpp.
Referenced by playDemo().
| void RfkWindow::stopBlinking | ( | ) | [private] |
Stops kitten blinking.
Definition at line 136 of file RfkWindow.cpp.
References m_blink, and m_blinkTimer.
Referenced by play_game(), and playDemo().
| void RfkWindow::timerEvent | ( | QTimerEvent * | event | ) | [slot] |
Makes kitten close or open its eyes.
Definition at line 142 of file RfkWindow.cpp.
References m_blink, m_blinkTimer, and startTimer().
| RfkView * RfkWindow::view | ( | ) |
Returns our view, so that it can be manipulated by other classes.
Definition at line 35 of file RfkWindow.cpp.
References m_view.
Referenced by RfkApplication::recreateModel().
QLabel* RfkWindow::m_blink [private] |
Kitten's eyes, closed.
Definition at line 86 of file RfkWindow.h.
Referenced by prepare_front_screen(), stopBlinking(), and timerEvent().
int RfkWindow::m_blinkTimer [private] |
ID of the timer that makes kitten blink.
Definition at line 91 of file RfkWindow.h.
Referenced by startBlinking(), stopBlinking(), and timerEvent().
RfkView* RfkWindow::m_view [private] |
A view of the board.
Definition at line 81 of file RfkWindow.h.
Referenced by RfkWindow(), and view().
1.6.3