@@ -82,22 +82,24 void LegendMarker::mousePressEvent(QGraphicsSceneMouseEvent *event) | |||||
82 | switch (mType) |
|
82 | switch (mType) | |
83 | { |
|
83 | { | |
84 | case LegendMarkerTypeSeries: { |
|
84 | case LegendMarkerTypeSeries: { | |
|
85 | qDebug() << "LegendMarker::mousePressEvent LegendMarkerTypeSeries" << event; | |||
85 | emit clicked(mSeries,event->button()); |
|
86 | emit clicked(mSeries,event->button()); | |
86 | break; |
|
87 | break; | |
87 | } |
|
88 | } | |
88 | case LegendMarkerTypeBarset: { |
|
89 | case LegendMarkerTypeBarset: { | |
|
90 | qDebug() << "LegendMarker::mousePressEvent LegendMarkerTypeBarset" << event; | |||
89 | emit clicked(mBarset,event->button()); |
|
91 | emit clicked(mBarset,event->button()); | |
90 | break; |
|
92 | break; | |
91 | } |
|
93 | } | |
92 | case LegendMarkerTypePieslice: { |
|
94 | case LegendMarkerTypePieslice: { | |
|
95 | qDebug() << "LegendMarker::mousePressEvent LegendMarkerTypePieslice" << event; | |||
93 | emit clicked(mPieslice,event->button()); |
|
96 | emit clicked(mPieslice,event->button()); | |
94 | break; |
|
97 | break; | |
95 | } |
|
98 | } | |
96 | default: { |
|
99 | default: { | |
97 | break; |
|
100 | break; | |
|
101 | } | |||
98 | } |
|
102 | } | |
99 | } |
|
|||
100 |
|
||||
101 | } |
|
103 | } | |
102 |
|
104 | |||
103 | #include "moc_legendmarker_p.cpp" |
|
105 | #include "moc_legendmarker_p.cpp" |
@@ -149,7 +149,7 void QLegend::createMarker(QXYSeries* series) | |||||
149 | void QLegend::createMarkers(QBarSeries *series) |
|
149 | void QLegend::createMarkers(QBarSeries *series) | |
150 | { |
|
150 | { | |
151 | foreach(QBarSet* s, series->barSets()) { |
|
151 | foreach(QBarSet* s, series->barSets()) { | |
152 |
LegendMarker* marker = new LegendMarker(s |
|
152 | LegendMarker* marker = new LegendMarker(s,this); | |
153 | marker->setName(s->name()); |
|
153 | marker->setName(s->name()); | |
154 | marker->setBrush(s->brush()); |
|
154 | marker->setBrush(s->brush()); | |
155 | connect(marker,SIGNAL(clicked(QBarSet*,Qt::MouseButton)),this,SIGNAL(clicked(QBarSet*,Qt::MouseButton))); |
|
155 | connect(marker,SIGNAL(clicked(QBarSet*,Qt::MouseButton)),this,SIGNAL(clicked(QBarSet*,Qt::MouseButton))); | |
@@ -161,7 +161,7 void QLegend::createMarkers(QBarSeries *series) | |||||
161 | void QLegend::createMarkers(QPieSeries *series) |
|
161 | void QLegend::createMarkers(QPieSeries *series) | |
162 | { |
|
162 | { | |
163 | foreach(QPieSlice* s, series->slices()) { |
|
163 | foreach(QPieSlice* s, series->slices()) { | |
164 |
LegendMarker* marker = new LegendMarker(s |
|
164 | LegendMarker* marker = new LegendMarker(s,this); | |
165 | marker->setName(s->label()); |
|
165 | marker->setName(s->label()); | |
166 | marker->setBrush(s->sliceBrush()); |
|
166 | marker->setBrush(s->sliceBrush()); | |
167 | connect(marker,SIGNAL(clicked(QPieSlice*,Qt::MouseButton)),this,SIGNAL(clicked(QPieSlice*,Qt::MouseButton))); |
|
167 | connect(marker,SIGNAL(clicked(QPieSlice*,Qt::MouseButton)),this,SIGNAL(clicked(QPieSlice*,Qt::MouseButton))); |
General Comments 0
You need to be logged in to leave comments.
Login now