@@ -77,6 +77,7 void QAreaLegendMarkerPrivate::updated() | |||
|
77 | 77 | { |
|
78 | 78 | m_item->setBrush(m_series->brush()); |
|
79 | 79 | m_item->setLabel(m_series->name()); |
|
80 | invalidateLegend(); | |
|
80 | 81 | } |
|
81 | 82 | |
|
82 | 83 | #include "moc_qarealegendmarker.cpp" |
@@ -86,6 +86,7 void QBarLegendMarkerPrivate::updated() | |||
|
86 | 86 | m_item->setPen(m_barset->pen()); |
|
87 | 87 | m_item->setBrush(m_barset->brush()); |
|
88 | 88 | m_item->setLabel(m_barset->label()); |
|
89 | invalidateLegend(); | |
|
89 | 90 | } |
|
90 | 91 | |
|
91 | 92 | #include "moc_qbarlegendmarker.cpp" |
@@ -102,6 +102,7 private: | |||
|
102 | 102 | friend class LegendLayout; |
|
103 | 103 | friend class ChartLayout; |
|
104 | 104 | friend class LegendMarkerItem; |
|
105 | friend class QLegendMarkerPrivate; | |
|
105 | 106 | }; |
|
106 | 107 | |
|
107 | 108 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -93,6 +93,7 private: | |||
|
93 | 93 | friend class QLegend; |
|
94 | 94 | friend class LegendMarkerItem; |
|
95 | 95 | friend class LegendLayout; |
|
96 | friend class QLegendMarkerPrivate; | |
|
96 | 97 | }; |
|
97 | 98 | |
|
98 | 99 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -22,6 +22,8 | |||
|
22 | 22 | #include "qlegendmarker_p.h" |
|
23 | 23 | #include "legendmarkeritem_p.h" |
|
24 | 24 | #include "qlegend.h" |
|
25 | #include "qlegend_p.h" | |
|
26 | #include "legendlayout_p.h" | |
|
25 | 27 | #include <QFontMetrics> |
|
26 | 28 | #include <QGraphicsSceneEvent> |
|
27 | 29 | #include <QAbstractSeries> |
@@ -112,6 +114,12 QLegendMarkerPrivate::~QLegendMarkerPrivate() | |||
|
112 | 114 | { |
|
113 | 115 | } |
|
114 | 116 | |
|
117 | void QLegendMarkerPrivate::invalidateLegend() | |
|
118 | { | |
|
119 | m_legend->d_ptr->m_layout->invalidate(); | |
|
120 | } | |
|
121 | ||
|
122 | ||
|
115 | 123 | |
|
116 | 124 | #include "moc_qlegendmarker.cpp" |
|
117 | 125 | #include "moc_qlegendmarker_p.cpp" |
@@ -65,8 +65,10 public: | |||
|
65 | 65 | virtual QAbstractSeries* series() = 0; |
|
66 | 66 | virtual QObject* relatedObject() = 0; |
|
67 | 67 | |
|
68 | void invalidateLegend(); | |
|
69 | ||
|
68 | 70 | public Q_SLOTS: |
|
69 |
virtual void updated() {} |
|
|
71 | virtual void updated() { invalidateLegend(); } | |
|
70 | 72 | |
|
71 | 73 | protected: |
|
72 | 74 | LegendMarkerItem *m_item; |
General Comments 0
You need to be logged in to leave comments.
Login now