project file fixes
[mardrone] / mardrone / gauge.cpp
1 /*==================================================================
2   !
3   !  mardrone application AR-Drone for MeeGo
4
5   ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6   ! All rights reserved.
7   !
8   !  Author:Kate Alhola  kate.alhola@nokia.com
9   !
10   ! GNU Lesser General Public License Usage
11   ! This file may be used under the terms of the GNU Lesser
12   ! General Public License version 2.1 as published by the Free Software
13   ! Foundation and appearing in the file LICENSE.LGPL included in the
14   ! packaging of this file.  Please review the following information to
15   ! ensure the GNU Lesser General Public License version 2.1 requirements
16   ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17   !
18   !
19   !
20   *===================================================================*/
21
22 #include "gauge.h"
23 #include "qgraphicswidget.h"
24 #include "QGraphicsItem"
25 #include <QPainter>
26 #include <QDebug>
27
28 Gauge::Gauge(QGraphicsItem *parent) :
29     QGraphicsWidget(parent)
30 {
31     qDebug() << "Gauge::Gauge()";
32 }
33 #if 1
34 void Gauge::paint(QPainter *painter,
35                            const QStyleOptionGraphicsItem *option,
36                            QWidget *widget)
37  {
38
39  }
40 #endif
41 void Gauge::setValue(float val_)
42 {
43     m_value=val_;
44     update(boundingRect()); // Value updated, schedule redtaw
45 };
46 float Gauge::value()
47 {
48     return m_value;
49 };
50
51 QRectF Gauge::boundingRect() const
52     {
53         return QRectF(0.0,0.0,size().width(),size().height());
54     }