• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kapman

  • sources
  • kde-4.14
  • kdegames
  • kapman
gameview.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef GAMEVIEW_H
19 #define GAMEVIEW_H
20 
21 #include "game.h"
22 
23 #include <QGraphicsView>
24 #include <QKeyEvent>
25 
30 class GameView : public QGraphicsView {
31 
32  Q_OBJECT
33 
34  public:
35 
40  GameView(Game* p_game);
41 
45  ~GameView();
46 
51  void resizeEvent(QResizeEvent* p_event);
52 
53  protected:
54 
59  void keyPressEvent(QKeyEvent* p_event);
60 
65  void focusOutEvent(QFocusEvent* p_event);
66 
67  signals:
68 
73  void keyPressed(QKeyEvent* p_event);
74 };
75 
76 #endif
77 
QResizeEvent
GameView
This class manages the drawing of each element of the Game instance.
Definition: gameview.h:30
GameView::GameView
GameView(Game *p_game)
Creates a new GameView instance.
Definition: gameview.cpp:21
game.h
GameView::keyPressed
void keyPressed(QKeyEvent *p_event)
Emitted on key press event for the Game instance.
GameView::focusOutEvent
void focusOutEvent(QFocusEvent *p_event)
Pauses the game on focus lost.
Definition: gameview.cpp:36
GameView::resizeEvent
void resizeEvent(QResizeEvent *p_event)
Resizes the items when the view is resized.
Definition: gameview.cpp:32
Game
This class manages the game main loop : it regularly checks the key press events, computes the charac...
Definition: game.h:35
QKeyEvent
GameView::keyPressEvent
void keyPressEvent(QKeyEvent *p_event)
Manages the player actions by hanlding the key press events.
Definition: gameview.cpp:43
GameView::~GameView
~GameView()
Deletes the GameView instance.
Definition: gameview.cpp:28
QFocusEvent
QGraphicsView
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kapman

Skip menu "kapman"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal