##// END OF EJS Templates
warnings are errors
Jani Honkonen -
r1011:07d304256b23
parent child
Show More
@@ -1,51 +1,49
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #include "drilldownchart.h"
22 22 #include <QAxis>
23 23
24 24 QTCOMMERCIALCHART_USE_NAMESPACE
25 25
26 26 DrilldownChart::DrilldownChart(QGraphicsItem *parent, Qt::WindowFlags wFlags)
27 27 : QChart(parent, wFlags)
28 28 ,m_currentSeries(0)
29 29 {
30 30 }
31 31
32 32 void DrilldownChart::changeSeries(QAbstractSeries *series)
33 33 {
34 if (m_currentSeries) {
34 if (m_currentSeries)
35 35 removeSeries(m_currentSeries);
36 }
37 36 m_currentSeries = series;
38 37 addSeries(series);
39 38 setTitle(series->name());
40 39 axisY()->setNiceNumbersEnabled(true);
41 40 }
42 41
43 42 void DrilldownChart::handleClicked(QBarSet *barset, QString category)
44 43 {
45 44 Q_UNUSED(barset)
46 Q_UNUSED(button)
47 45 DrilldownBarSeries* series = static_cast<DrilldownBarSeries*> (sender());
48 46 changeSeries(series->drilldownSeries(category));
49 47 }
50 48
51 49 #include "moc_drilldownchart.cpp"
@@ -1,58 +1,59
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #include "bar_p.h"
22 22 #include <QDebug>
23 23 #include <QPainter>
24 24 #include <QGraphicsSceneEvent>
25 25
26 26 QTCOMMERCIALCHART_BEGIN_NAMESPACE
27 27
28 28 Bar::Bar(QBarSet *barset, QString category, QGraphicsItem *parent) : QGraphicsRectItem(parent),
29 29 m_category(category),
30 30 m_barset(barset)
31 31 {
32 32 setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
33 33 setAcceptHoverEvents(true);
34 34 }
35 35
36 36 void Bar::mousePressEvent(QGraphicsSceneMouseEvent *event)
37 37 {
38 Q_UNUSED(event)
38 39 emit clicked(m_category);
39 40 emit clicked(m_barset, m_category);
40 41 }
41 42
42 43 void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
43 44 {
44 45 Q_UNUSED(event)
45 46 emit hovered(true);
46 47 emit hovered(m_barset, true);
47 48 }
48 49
49 50 void Bar::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
50 51 {
51 52 Q_UNUSED(event)
52 53 emit hovered(false);
53 54 emit hovered(m_barset, false);
54 55 }
55 56
56 57 #include "moc_bar_p.cpp"
57 58
58 59 QTCOMMERCIALCHART_END_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now