1 | /*************************************************************************** |
2 | * KBlocks, a falling blocks game for KDE * |
3 | * Copyright (C) 2010 Mauricio Piacentini <mauricio@tabuleiro.com> * |
4 | * Zhongjie Cai <squall.leonhart.cai@gmail.com> * |
5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License as published by * |
8 | * the Free Software Foundation; either version 2 of the License, or * |
9 | * (at your option) any later version. * |
10 | ***************************************************************************/ |
11 | #ifndef KBLOCKSVIEW_H |
12 | #define KBLOCKSVIEW_H |
13 | |
14 | #include <QGraphicsView> |
15 | |
16 | #include "KBlocksScene.h" |
17 | |
18 | class KBlocksView : public QGraphicsView |
19 | { |
20 | Q_OBJECT |
21 | |
22 | public: |
23 | explicit KBlocksView(KBlocksScene * scene, QWidget * parent = 0); |
24 | ~KBlocksView(); |
25 | |
26 | signals: |
27 | void focusEvent(bool flag); |
28 | |
29 | public slots: |
30 | void settingsChanged(); |
31 | |
32 | protected: |
33 | void focusInEvent(QFocusEvent * event); |
34 | void focusOutEvent(QFocusEvent * event); |
35 | void resizeEvent(QResizeEvent * event); |
36 | |
37 | protected: |
38 | KBlocksScene* mpGameScene; |
39 | }; |
40 | |
41 | #endif |
42 | |
43 | |