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