SCXMLEditor: Make names and conditions movable

Fixes: QTCREATORBUG-31397
Change-Id: I275523b4e66f934a0d2029335acb56d789386c6e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Artem Sokolovskii
2024-08-27 15:32:46 +02:00
parent 143aa43ec2
commit 0aa5116bc1

View File

@@ -32,7 +32,6 @@ static QString wrapText(const QString &text)
{ {
QString wrappedText = "[" + text.trimmed() + "]"; QString wrappedText = "[" + text.trimmed() + "]";
return wrappedText; return wrappedText;
} }
static QString unwrapText(const QString &text) static QString unwrapText(const QString &text)
@@ -921,14 +920,15 @@ void TransitionItem::updateComponents()
} else { } else {
const qreal widthEventItem = m_eventTagItem->boundingRect().width() / 2; const qreal widthEventItem = m_eventTagItem->boundingRect().width() / 2;
m_eventTagItem->setPos( m_eventTagItem->setPos(
nameLine.pointAt(0.5) nameLine.pointAt(0.5) + m_eventTagItem->movePoint()
+ QPointF(-widthEventItem, -m_eventTagItem->boundingRect().height() / 1.5)); + QPointF(-widthEventItem, -m_eventTagItem->boundingRect().height() / 1.5));
const qreal width = qMax(nameLine.length(), m_eventTagItem->boundingRect().width()); qreal width = qMax(nameLine.length(), m_eventTagItem->boundingRect().width());
m_condTagItem->setTextMaxWidth(width); m_condTagItem->setTextMaxWidth(width);
const qreal widthCondItem = m_condTagItem->boundingRect().width() / 2;
m_condTagItem->setPos(nameLine.pointAt(0.5) + QPointF(-widthCondItem, 2));
const qreal widthCondItem = m_condTagItem->boundingRect().width() / 2;
m_condTagItem->setPos(
nameLine.pointAt(0.5) + m_condTagItem->movePoint() + QPointF(-widthCondItem, 2));
} }
if (m_warningItem) if (m_warningItem)