diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp index 8bfcd04206524e185385f2d239057e5fd7c2abf7..4d7a0551209c525d8f10f2c34a6579b07b4b7f33 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp @@ -92,7 +92,6 @@ void FormEditorItem::updateGeometry() m_boundingRect = qmlItemNode().instanceBoundingRect().adjusted(0, 0, 1., 1.); m_paintedBoundingRect = qmlItemNode().instancePaintedBoundingRect().united(m_boundingRect); setTransform(qmlItemNode().instanceTransformWithContentTransform()); - setTransform(m_attentionTransform, true); //the property for zValue is called z in QGraphicsObject if (qmlItemNode().instanceValue("z").isValid()) setZValue(qmlItemNode().instanceValue("z").toDouble()); @@ -104,63 +103,12 @@ void FormEditorItem::updateVisibilty() // setOpacity(nodeInstance().opacity()); } -void FormEditorItem::showAttention() -{ - if (m_attentionTimeLine.isNull()) { - m_attentionTimeLine = new QTimeLine(500, this); - m_attentionTimeLine->setCurveShape(QTimeLine::SineCurve); - connect(m_attentionTimeLine.data(), SIGNAL(valueChanged(qreal)), SLOT(changeAttention(qreal))); - connect(m_attentionTimeLine.data(), SIGNAL(finished()), m_attentionTimeLine.data(), SLOT(deleteLater())); - - m_attentionTimeLine->start(); - } -} - -void FormEditorItem::changeAttention(qreal value) -{ - if (QGraphicsItem::parentItem() == scene()->formLayerItem()) { - setAttentionHighlight(value); - } else { - setAttentionHighlight(value); - setAttentionScale(value); - } -} FormEditorView *FormEditorItem::formEditorView() const { return scene()->editorView(); } -void FormEditorItem::setAttentionScale(double sinusScale) -{ - if (!qFuzzyIsNull(sinusScale)) { - double scale = std::sqrt(sinusScale); - m_attentionTransform.reset(); - QPointF centerPoint(qmlItemNode().instanceBoundingRect().center()); - m_attentionTransform.translate(centerPoint.x(), centerPoint.y()); - m_attentionTransform.scale(scale * 0.15 + 1.0, scale * 0.15 + 1.0); - m_attentionTransform.translate(-centerPoint.x(), -centerPoint.y()); - m_inverseAttentionTransform = m_attentionTransform.inverted(); - prepareGeometryChange(); - setTransform(qmlItemNode().instanceTransformWithContentTransform()); - setTransform(m_attentionTransform, true); - } else { - m_attentionTransform.reset(); - prepareGeometryChange(); - setTransform(qmlItemNode().instanceTransform()); - } -} - -void FormEditorItem::setAttentionHighlight(double value) -{ - if (QGraphicsItem::parentItem() == scene()->formLayerItem()) - m_borderWidth = value * 4; - else - m_borderWidth = 1. + value * 3; - - update(); -} - void FormEditorItem::setHighlightBoundingRect(bool highlight) { if (m_highlightBoundingRect != highlight) { diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.h b/src/plugins/qmldesigner/components/formeditor/formeditoritem.h index ff133c70d5ed8405a11b7751c1ca56bbde0e6318..288b6a7695f42c134b112f60f3792c85afceceb1 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.h +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.h @@ -111,20 +111,14 @@ protected: void paintBoundingRect(QPainter *painter) const; void paintPlaceHolderForInvisbleItem(QPainter *painter) const; -private slots: - void changeAttention(qreal value); - private: // functions FormEditorItem(const QmlItemNode &qmlItemNode, FormEditorScene* scene); void setup(); - void setAttentionScale(double scale); - void setAttentionHighlight(double value); private: // variables SnappingLineCreator m_snappingLineCreator; QmlItemNode m_qmlItemNode; QWeakPointer<QTimeLine> m_attentionTimeLine; - QTransform m_attentionTransform; // make item larger in anchor mode QTransform m_inverseAttentionTransform; QRectF m_boundingRect; QRectF m_paintedBoundingRect;