RfkWindow Class Reference

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.
RfkViewview ()
 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

RfkViewm_view
 A view of the board.
QLabel * m_blink
 Kitten's eyes, closed.
int m_blinkTimer
 ID of the timer that makes kitten blink.

Detailed Description

The main window of the game.

Contains the view.

Definition at line 10 of file RfkWindow.h.


Constructor & Destructor Documentation

RfkWindow::RfkWindow (  ) 

Constructs the window.

Definition at line 12 of file RfkWindow.cpp.

References m_view, prepare_front_screen(), and restart().


Member Function Documentation

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.

Parameters:
event Details of the keypress.

Definition at line 126 of file RfkWindow.cpp.

void RfkWindow::play_game (  )  [slot]

Received when the game begins.

Bug:
Use camelcase.

Definition at line 105 of file RfkWindow.cpp.

References stopBlinking().

Referenced by prepare_front_screen().

void RfkWindow::playDemo (  )  [slot]

Received when the demo begins.

Bug:
Should probably be private.

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.

Returns:
The front screen.

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.

Bug:
Should probably be private.

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.

Returns:
The view

Definition at line 35 of file RfkWindow.cpp.

References m_view.

Referenced by RfkApplication::recreateModel().


Field Documentation

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().

A view of the board.

Definition at line 81 of file RfkWindow.h.

Referenced by RfkWindow(), and view().


The documentation for this class was generated from the following files:
Generated on Sat Nov 20 15:06:23 2010 for robotfindskitten by  doxygen 1.6.3