forked from qt-creator/qt-creator
QmlDesigner: Use constants for flow block size
Change-Id: I0ba4fbc89e7fc6bf9ef1266b5cc4a19bb7837b12 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -46,6 +46,8 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
const int flowBlockSize = 200;
|
||||||
|
|
||||||
FormEditorScene *FormEditorItem::scene() const {
|
FormEditorScene *FormEditorItem::scene() const {
|
||||||
return qobject_cast<FormEditorScene*>(QGraphicsItem::scene());
|
return qobject_cast<FormEditorScene*>(QGraphicsItem::scene());
|
||||||
}
|
}
|
||||||
@@ -710,7 +712,7 @@ void FormEditorTransitionItem::updateGeometry()
|
|||||||
QPointF toP = QmlItemNode(resolved.to).flowPosition();
|
QPointF toP = QmlItemNode(resolved.to).flowPosition();
|
||||||
|
|
||||||
if (QmlItemNode(resolved.to).isFlowDecision())
|
if (QmlItemNode(resolved.to).isFlowDecision())
|
||||||
sizeTo = QRectF(0,0,200,200);
|
sizeTo = QRectF(0, 0, flowBlockSize, flowBlockSize);
|
||||||
|
|
||||||
qreal x1 = fromP.x();
|
qreal x1 = fromP.x();
|
||||||
qreal x2 = toP.x();
|
qreal x2 = toP.x();
|
||||||
@@ -989,10 +991,10 @@ void FormEditorTransitionItem::paint(QPainter *painter, const QStyleOptionGraphi
|
|||||||
|
|
||||||
QRectF fromRect = QmlItemNode(resolved.from).instanceBoundingRect();
|
QRectF fromRect = QmlItemNode(resolved.from).instanceBoundingRect();
|
||||||
if (QmlItemNode(resolved.from).isFlowDecision())
|
if (QmlItemNode(resolved.from).isFlowDecision())
|
||||||
fromRect = QRectF(0,0,200,200);
|
fromRect = QRectF(0, 0, flowBlockSize, flowBlockSize);
|
||||||
|
|
||||||
if (QmlItemNode(resolved.from).isFlowWildcard())
|
if (QmlItemNode(resolved.from).isFlowWildcard())
|
||||||
fromRect = QRectF(0,0,200,200);
|
fromRect = QRectF(0, 0, flowBlockSize, flowBlockSize);
|
||||||
fromRect.translate(QmlItemNode(resolved.from).flowPosition());
|
fromRect.translate(QmlItemNode(resolved.from).flowPosition());
|
||||||
|
|
||||||
if (resolved.isStartLine) {
|
if (resolved.isStartLine) {
|
||||||
@@ -1008,7 +1010,7 @@ void FormEditorTransitionItem::paint(QPainter *painter, const QStyleOptionGraphi
|
|||||||
|
|
||||||
QRectF toRect = QmlItemNode(resolved.to).instanceBoundingRect();
|
QRectF toRect = QmlItemNode(resolved.to).instanceBoundingRect();
|
||||||
if (QmlItemNode(resolved.to).isFlowDecision())
|
if (QmlItemNode(resolved.to).isFlowDecision())
|
||||||
toRect = QRectF(0,0,200,200);
|
toRect = QRectF(0, 0, flowBlockSize,flowBlockSize);
|
||||||
|
|
||||||
toRect.translate(QmlItemNode(resolved.to).flowPosition());
|
toRect.translate(QmlItemNode(resolved.to).flowPosition());
|
||||||
|
|
||||||
@@ -1112,7 +1114,7 @@ QTransform FormEditorItem::viewportTransform() const
|
|||||||
void FormEditorFlowDecisionItem::updateGeometry()
|
void FormEditorFlowDecisionItem::updateGeometry()
|
||||||
{
|
{
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
m_selectionBoundingRect = QRectF(0,0, 200, 200);
|
m_selectionBoundingRect = QRectF(0,0, flowBlockSize, flowBlockSize);
|
||||||
m_paintedBoundingRect = m_selectionBoundingRect;
|
m_paintedBoundingRect = m_selectionBoundingRect;
|
||||||
m_boundingRect = m_paintedBoundingRect;
|
m_boundingRect = m_paintedBoundingRect;
|
||||||
setTransform(qmlItemNode().instanceTransformWithContentTransform());
|
setTransform(qmlItemNode().instanceTransformWithContentTransform());
|
||||||
|
Reference in New Issue
Block a user