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

granatier

  • sources
  • kde-4.14
  • kdegames
  • granatier
  • src
gameview.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009 Mathias Kraus <k.hias@gmx.de>
3  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef GAMEVIEW_H
20 #define GAMEVIEW_H
21 
22 #include <QGraphicsView>
23 
24 class QKeyEvent;
25 class Game;
26 class GameScene;
27 
32 class GameView : public QGraphicsView {
33 
34 Q_OBJECT
35 
36 public:
37 
42  GameView(GameScene* p_scene, Game* p_game);
43 
47  ~GameView();
48 
53  void resizeEvent(QResizeEvent* p_event);
54 
55 protected:
56 
61  void keyPressEvent(QKeyEvent* p_event);
62 
67  void keyReleaseEvent(QKeyEvent* p_event);
68 
73  void focusOutEvent(QFocusEvent* p_event);
74 
75 signals:
76 
81  void keyPressed(QKeyEvent* p_event);
82 
87  void keyReleased(QKeyEvent* p_event);
88 };
89 
90 #endif
91 
QResizeEvent
GameView
This class manages the drawing of each element of the Game instance.
Definition: gameview.h:32
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:48
GameView::keyReleased
void keyReleased(QKeyEvent *p_event)
Emitted on key release event for the Game instance.
GameView::resizeEvent
void resizeEvent(QResizeEvent *p_event)
Resizes the items when the view is resized.
Definition: gameview.cpp:43
Game
This class manages the game main loop : it regularly checks the key press events, computes the charac...
Definition: game.h:43
GameView::keyReleaseEvent
void keyReleaseEvent(QKeyEvent *p_event)
Manages the player actions by hanlding the key release events.
Definition: gameview.cpp:66
QKeyEvent
GameView::keyPressEvent
void keyPressEvent(QKeyEvent *p_event)
Manages the player actions by hanlding the key press events.
Definition: gameview.cpp:57
GameScene
This class contains all the Game elements to be drawn on the screen by the GameView instance...
Definition: gamescene.h:50
GameView::~GameView
~GameView()
Deletes the GameView instance.
Definition: gameview.cpp:38
QFocusEvent
GameView::GameView
GameView(GameScene *p_scene, Game *p_game)
Creates a new GameView instance.
Definition: gameview.cpp:26
QGraphicsView
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

granatier

Skip menu "granatier"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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