@@ -36,21 +36,18 Bar::Bar(QBarSet *barset, QString category, QGraphicsItem *parent) : QGraphicsRe | |||||
36 | void Bar::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
36 | void Bar::mousePressEvent(QGraphicsSceneMouseEvent *event) | |
37 | { |
|
37 | { | |
38 | Q_UNUSED(event) |
|
38 | Q_UNUSED(event) | |
39 | emit clicked(m_category); |
|
|||
40 | emit clicked(m_barset, m_category); |
|
39 | emit clicked(m_barset, m_category); | |
41 | } |
|
40 | } | |
42 |
|
41 | |||
43 | void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
42 | void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
44 | { |
|
43 | { | |
45 | Q_UNUSED(event) |
|
44 | Q_UNUSED(event) | |
46 | emit hovered(true); |
|
|||
47 | emit hovered(m_barset, true); |
|
45 | emit hovered(m_barset, true); | |
48 | } |
|
46 | } | |
49 |
|
47 | |||
50 | void Bar::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
48 | void Bar::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
51 | { |
|
49 | { | |
52 | Q_UNUSED(event) |
|
50 | Q_UNUSED(event) | |
53 | emit hovered(false); |
|
|||
54 | emit hovered(m_barset, false); |
|
51 | emit hovered(m_barset, false); | |
55 | } |
|
52 | } | |
56 |
|
53 |
@@ -81,9 +81,7 void BarChartItem::dataChanged() | |||||
81 | // Bars |
|
81 | // Bars | |
82 | Bar *bar = new Bar(set,category,this); |
|
82 | Bar *bar = new Bar(set,category,this); | |
83 | m_bars.append(bar); |
|
83 | m_bars.append(bar); | |
84 | connect(bar, SIGNAL(clicked(QString)), set, SIGNAL(clicked(QString))); |
|
|||
85 | connect(bar, SIGNAL(clicked(QBarSet*,QString)), m_series, SIGNAL(clicked(QBarSet*,QString))); |
|
84 | connect(bar, SIGNAL(clicked(QBarSet*,QString)), m_series, SIGNAL(clicked(QBarSet*,QString))); | |
86 | connect(bar, SIGNAL(hovered(bool)), set, SIGNAL(hovered(bool))); |
|
|||
87 | connect(bar, SIGNAL(hovered(QBarSet*,bool)), m_series, SIGNAL(hovered(QBarSet*,bool))); |
|
85 | connect(bar, SIGNAL(hovered(QBarSet*,bool)), m_series, SIGNAL(hovered(QBarSet*,bool))); | |
88 | m_layout.append(QRectF(0, 0, 0, 0)); |
|
86 | m_layout.append(QRectF(0, 0, 0, 0)); | |
89 |
|
87 |
@@ -72,9 +72,9 public: | |||||
72 | void setLabelFont(const QFont &font); |
|
72 | void setLabelFont(const QFont &font); | |
73 | QFont labelFont() const; |
|
73 | QFont labelFont() const; | |
74 |
|
74 | |||
75 | Q_SIGNALS: |
|
75 | //Q_SIGNALS: | |
76 | void clicked(QString category); |
|
76 | // void clicked(QString category); | |
77 | void hovered(bool status); |
|
77 | // void hovered(bool status); | |
78 |
|
78 | |||
79 | private: |
|
79 | private: | |
80 | QScopedPointer<QBarSetPrivate> d_ptr; |
|
80 | QScopedPointer<QBarSetPrivate> d_ptr; |
General Comments 0
You need to be logged in to leave comments.
Login now