@@ -131,6 +131,8 void PieSliceItem::updateGeometry() | |||
|
131 | 131 | QPointF armStart; |
|
132 | 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 | 136 | if (m_data.m_isLabelVisible) { |
|
135 | 137 | // text rect |
|
136 | 138 | QFontMetricsF fm(m_data.m_labelFont); |
@@ -139,7 +141,6 void PieSliceItem::updateGeometry() | |||
|
139 | 141 | 0); |
|
140 | 142 | |
|
141 | 143 | QString label(m_data.m_labelText); |
|
142 | m_labelItem->setVisible(m_data.m_isLabelVisible); | |
|
143 | 144 | m_labelItem->setDefaultTextColor(m_data.m_labelBrush.color()); |
|
144 | 145 | m_labelItem->setFont(m_data.m_labelFont); |
|
145 | 146 | |
@@ -203,6 +204,8 void PieSliceItem::updateGeometry() | |||
|
203 | 204 | m_labelItem->setRotation(m_data.m_startAngle + m_data.m_angleSpan / 2 - 90); |
|
204 | 205 | else |
|
205 | 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