@@ -131,6 +131,8 void PieSliceItem::updateGeometry() | |||||
131 | QPointF armStart; |
|
131 | QPointF armStart; | |
132 | m_slicePath = slicePath(m_data.m_center, m_data.m_radius, m_data.m_startAngle, m_data.m_angleSpan, ¢erAngle, &armStart); |
|
132 | m_slicePath = slicePath(m_data.m_center, m_data.m_radius, m_data.m_startAngle, m_data.m_angleSpan, ¢erAngle, &armStart); | |
133 |
|
133 | |||
|
134 | m_labelItem->setVisible(m_data.m_isLabelVisible); | |||
|
135 | ||||
134 | if (m_data.m_isLabelVisible) { |
|
136 | if (m_data.m_isLabelVisible) { | |
135 | // text rect |
|
137 | // text rect | |
136 | QFontMetricsF fm(m_data.m_labelFont); |
|
138 | QFontMetricsF fm(m_data.m_labelFont); | |
@@ -139,7 +141,6 void PieSliceItem::updateGeometry() | |||||
139 | 0); |
|
141 | 0); | |
140 |
|
142 | |||
141 | QString label(m_data.m_labelText); |
|
143 | QString label(m_data.m_labelText); | |
142 | m_labelItem->setVisible(m_data.m_isLabelVisible); |
|
|||
143 | m_labelItem->setDefaultTextColor(m_data.m_labelBrush.color()); |
|
144 | m_labelItem->setDefaultTextColor(m_data.m_labelBrush.color()); | |
144 | m_labelItem->setFont(m_data.m_labelFont); |
|
145 | m_labelItem->setFont(m_data.m_labelFont); | |
145 |
|
146 | |||
@@ -203,6 +204,8 void PieSliceItem::updateGeometry() | |||||
203 | m_labelItem->setRotation(m_data.m_startAngle + m_data.m_angleSpan / 2 - 90); |
|
204 | m_labelItem->setRotation(m_data.m_startAngle + m_data.m_angleSpan / 2 - 90); | |
204 | else |
|
205 | else | |
205 | m_labelItem->setRotation(m_data.m_startAngle + m_data.m_angleSpan / 2 + 90); |
|
206 | m_labelItem->setRotation(m_data.m_startAngle + m_data.m_angleSpan / 2 + 90); | |
|
207 | } else { | |||
|
208 | m_labelItem->setRotation(0); | |||
206 | } |
|
209 | } | |
207 | } |
|
210 | } | |
208 | } |
|
211 | } |
General Comments 0
You need to be logged in to leave comments.
Login now