! calculates the position of the label, when the position relative to the parent was specified (left, right, etc.) */
| 573 | calculates the position of the label, when the position relative to the parent was specified (left, right, etc.) |
| 574 | */ |
| 575 | void TextLabelPrivate::updatePosition() { |
| 576 | if (q->isLoading()) |
| 577 | return; |
| 578 | |
| 579 | if (q->m_type == TextLabel::Type::AxisTitle) { |
| 580 | // In an axis element, the label is part of the bounding rect of the axis |
| 581 | // so it is not possible to align with the bounding rect |
| 582 | QPointF p = position.point; |
| 583 | suppressItemChangeEvent = true; |
| 584 | setPos(p); |
| 585 | suppressItemChangeEvent = false; |
| 586 | |
| 587 | Q_EMIT q->positionChanged(position); |
| 588 | |
| 589 | // the position in scene coordinates was changed, calculate the position in logical coordinates |
| 590 | if (q->cSystem) { |
| 591 | if (!coordinateBindingEnabled) { |
| 592 | QPointF pos = q->align(p, m_boundingRectangle, horizontalAlignment, verticalAlignment, false); |
| 593 | positionLogical = q->cSystem->mapSceneToLogical(pos, AbstractCoordinateSystem::MappingFlag::SuppressPageClipping); |
| 594 | } |
| 595 | Q_EMIT q->positionLogicalChanged(positionLogical); |
| 596 | } |
| 597 | } else |
| 598 | WorksheetElementPrivate::updatePosition(); |
| 599 | } |
| 600 | |
| 601 | /*! |
| 602 | updates the static text. |
no test coverage detected