@@ -220,7 +220,8 void PolarChartAxisAngular::updateGeometry() | |||||
220 | // Title, centered above the chart |
|
220 | // Title, centered above the chart | |
221 | QString titleText = axis()->titleText(); |
|
221 | QString titleText = axis()->titleText(); | |
222 | if (!titleText.isEmpty() && axis()->isTitleVisible()) { |
|
222 | if (!titleText.isEmpty() && axis()->isTitleVisible()) { | |
223 | title->setHtml(ChartPresenter::truncatedText(axis()->titleFont(), titleText, qreal(0.0), axisGeometry().width(), Qt::Horizontal, QRectF())); |
|
223 | QRectF dummyRect; | |
|
224 | title->setHtml(ChartPresenter::truncatedText(axis()->titleFont(), titleText, qreal(0.0), axisGeometry().width(), Qt::Horizontal, dummyRect)); | |||
224 |
|
225 | |||
225 | QRectF titleBoundingRect = title->boundingRect(); |
|
226 | QRectF titleBoundingRect = title->boundingRect(); | |
226 | QPointF titleCenter = center - titleBoundingRect.center(); |
|
227 | QPointF titleCenter = center - titleBoundingRect.center(); |
@@ -203,7 +203,8 void PolarChartAxisRadial::updateGeometry() | |||||
203 | // Title, along the 0 axis |
|
203 | // Title, along the 0 axis | |
204 | QString titleText = axis()->titleText(); |
|
204 | QString titleText = axis()->titleText(); | |
205 | if (!titleText.isEmpty() && axis()->isTitleVisible()) { |
|
205 | if (!titleText.isEmpty() && axis()->isTitleVisible()) { | |
206 | title->setHtml(ChartPresenter::truncatedText(axis()->titleFont(), titleText, qreal(0.0), radius, Qt::Horizontal, QRectF())); |
|
206 | QRectF dummyRect; | |
|
207 | title->setHtml(ChartPresenter::truncatedText(axis()->titleFont(), titleText, qreal(0.0), radius, Qt::Horizontal, dummyRect)); | |||
207 |
|
208 | |||
208 | QRectF titleBoundingRect = title->boundingRect(); |
|
209 | QRectF titleBoundingRect = title->boundingRect(); | |
209 | QPointF titleCenter = titleBoundingRect.center(); |
|
210 | QPointF titleCenter = titleBoundingRect.center(); |
@@ -49,7 +49,8 QString ChartTitle::text() const | |||||
49 |
|
49 | |||
50 | void ChartTitle::setGeometry(const QRectF &rect) |
|
50 | void ChartTitle::setGeometry(const QRectF &rect) | |
51 | { |
|
51 | { | |
52 | QGraphicsTextItem::setHtml(ChartPresenter::truncatedText(font(), m_text, qreal(0.0), rect.width(), Qt::Horizontal, QRectF())); |
|
52 | QRectF dummyRect; | |
|
53 | QGraphicsTextItem::setHtml(ChartPresenter::truncatedText(font(), m_text, qreal(0.0), rect.width(), Qt::Horizontal, dummyRect)); | |||
53 | setPos(rect.topLeft()); |
|
54 | setPos(rect.topLeft()); | |
54 | } |
|
55 | } | |
55 |
|
56 |
General Comments 0
You need to be logged in to leave comments.
Login now