PageRenderTime 103ms CodeModel.GetById 96ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/pitchscene.h

http://cutefootball.googlecode.com/
C++ Header | 52 lines | 25 code | 8 blank | 19 comment | 0 complexity | 79282b62aea95923ab226185651798f5 MD5 | raw file
 1/*
 2 * Copyright 2010,2011 Timothy Rochford
 3 *
 4 *    This file is part of CuteFootball.
 5 *
 6 *    CuteFootball is free software: you can redistribute it and/or modify
 7 *    it under the terms of the Lesser GNU General Public License as published by
 8 *    the Free Software Foundation, either version 3 of the License, or
 9 *    (at your option) any later version.
10 *
11 *    CuteFootball is distributed in the hope that it will be useful,
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *    Lesser GNU General Public License for more details.
15 *
16 *    You should have received a copy of the Lesser GNU General Public License
17 *    along with CuteFootball.  If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef PITCHSCENE_H
22#define PITCHSCENE_H
23
24#include <QGraphicsScene>
25
26#include "settingsFrame.h"
27
28class QTimer;
29class Pitch;
30
31class PitchScene : public QGraphicsScene
32{
33    Q_OBJECT;
34public:
35    explicit PitchScene(const QRectF& footballGroundRect,
36                        Pitch* pitch,
37                        QObject *parent = 0);
38    virtual ~PitchScene();
39public slots:
40    void setInputMethod(settingsFrame::InputMethod method) { m_inputMethod = method; }
41
42private:
43    void mousePressEvent(QGraphicsSceneMouseEvent *e);
44
45private:
46    Pitch* m_pitch;
47    settingsFrame::InputMethod m_inputMethod;
48    QTimer* m_doubleTapTimer;
49    QPointF m_lastTapPoint;
50};
51
52#endif // PITCHSCENE_H