diff options
author | Marco Bubke <marco.bubke@nokia.com> | 2010-01-18 18:56:01 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@nokia.com> | 2010-01-18 18:56:18 +0100 |
commit | 7b9e8b314b37193d6ef6e830cc44e60177e247cc (patch) | |
tree | 966880174ca584206f685ed6d773ed95d1bbcca0 /src | |
parent | 5dce709263992a761ffc879f81f6c5f8d1f6aba9 (diff) | |
download | qt-creator-7b9e8b314b37193d6ef6e830cc44e60177e247cc.tar.gz |
Block signals to prevent a cycle
Task-number: BAUHAUS-292
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmldesigner/core/instances/qmlgraphicsitemnodeinstance.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/plugins/qmldesigner/core/instances/qmlgraphicsitemnodeinstance.cpp b/src/plugins/qmldesigner/core/instances/qmlgraphicsitemnodeinstance.cpp index be28b1dd61..ce297fd2ec 100644 --- a/src/plugins/qmldesigner/core/instances/qmlgraphicsitemnodeinstance.cpp +++ b/src/plugins/qmldesigner/core/instances/qmlgraphicsitemnodeinstance.cpp @@ -96,23 +96,35 @@ QSizeF QmlGraphicsItemNodeInstance::size() const double implicitWidth = qmlGraphicsItem()->implicitWidth(); if (!m_hasWidth && implicitWidth // WORKAROUND - && implicitWidth != qmlGraphicsItem()->width()) + && implicitWidth != qmlGraphicsItem()->width()) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setWidth(implicitWidth); + qmlGraphicsItem()->blockSignals(false); + } double implicitHeight = qmlGraphicsItem()->implicitHeight(); if (!m_hasHeight && implicitWidth // WORKAROUND - && implicitHeight != qmlGraphicsItem()->height()) + && implicitHeight != qmlGraphicsItem()->height()) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setHeight(implicitHeight); + qmlGraphicsItem()->blockSignals(false); + } } if (modelNode().isRootNode()) { - if (!m_hasWidth) + if (!m_hasWidth) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setWidth(100.); + qmlGraphicsItem()->blockSignals(false); + } - if (!m_hasHeight) + if (!m_hasHeight) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setHeight(100.); + qmlGraphicsItem()->blockSignals(false); + } } return QSizeF(qmlGraphicsItem()->width(), qmlGraphicsItem()->height()); @@ -124,23 +136,35 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const double implicitWidth = qmlGraphicsItem()->implicitWidth(); if (!m_hasWidth && implicitWidth // WORKAROUND - && implicitWidth != qmlGraphicsItem()->width()) + && implicitWidth != qmlGraphicsItem()->width()) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setWidth(implicitWidth); + qmlGraphicsItem()->blockSignals(false); + } double implicitHeight = qmlGraphicsItem()->implicitHeight(); if (!m_hasHeight && implicitWidth // WORKAROUND - && implicitHeight != qmlGraphicsItem()->height()) + && implicitHeight != qmlGraphicsItem()->height()) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setHeight(implicitHeight); + qmlGraphicsItem()->blockSignals(false); + } } if (modelNode().isRootNode()) { - if (!m_hasWidth) + if (!m_hasWidth) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setWidth(100.); + qmlGraphicsItem()->blockSignals(false); + } - if (!m_hasHeight) + if (!m_hasHeight) { + qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->setHeight(100.); + qmlGraphicsItem()->blockSignals(false); + } } return qmlGraphicsItem()->boundingRect(); |