Commit 199d1e14 authored by Marco Bubke's avatar Marco Bubke
Browse files

Fix binding bug for width and height.

Task-Id: BAUHAUS-472
parent 083988b2
......@@ -98,7 +98,8 @@ QSizeF QmlGraphicsItemNodeInstance::size() const
double implicitWidth = qmlGraphicsItem()->implicitWidth();
if (!m_hasWidth
&& implicitWidth // WORKAROUND
&& implicitWidth != qmlGraphicsItem()->width()) {
&& implicitWidth != qmlGraphicsItem()->width()
&& !modelNode().hasBindingProperty("width")) {
qmlGraphicsItem()->blockSignals(true);
qmlGraphicsItem()->setWidth(implicitWidth);
qmlGraphicsItem()->blockSignals(false);
......@@ -107,7 +108,8 @@ QSizeF QmlGraphicsItemNodeInstance::size() const
double implicitHeight = qmlGraphicsItem()->implicitHeight();
if (!m_hasHeight
&& implicitWidth // WORKAROUND
&& implicitHeight != qmlGraphicsItem()->height()) {
&& implicitHeight != qmlGraphicsItem()->height()
&& !modelNode().hasBindingProperty("height")) {
qmlGraphicsItem()->blockSignals(true);
qmlGraphicsItem()->setHeight(implicitHeight);
qmlGraphicsItem()->blockSignals(false);
......@@ -138,7 +140,8 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const
double implicitWidth = qmlGraphicsItem()->implicitWidth();
if (!m_hasWidth
&& implicitWidth // WORKAROUND
&& implicitWidth != qmlGraphicsItem()->width()) {
&& implicitWidth != qmlGraphicsItem()->width()
&& !modelNode().hasBindingProperty("width")) {
qmlGraphicsItem()->blockSignals(true);
qmlGraphicsItem()->setWidth(implicitWidth);
qmlGraphicsItem()->blockSignals(false);
......@@ -147,7 +150,8 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const
double implicitHeight = qmlGraphicsItem()->implicitHeight();
if (!m_hasHeight
&& implicitWidth // WORKAROUND
&& implicitHeight != qmlGraphicsItem()->height()) {
&& implicitHeight != qmlGraphicsItem()->height()
&& !modelNode().hasBindingProperty("height")) {
qmlGraphicsItem()->blockSignals(true);
qmlGraphicsItem()->setHeight(implicitHeight);
qmlGraphicsItem()->blockSignals(false);
......@@ -215,7 +219,7 @@ void QmlGraphicsItemNodeInstance::setPropertyBinding(const QString &name, const
QVariant QmlGraphicsItemNodeInstance::property(const QString &name) const
{
if (name == "width" && modelNode().isValid()) {
if (name == "width" && modelNode().isValid() && !modelNode().hasBindingProperty("width")) {
double implicitWidth = qmlGraphicsItem()->implicitWidth();
if (!m_hasWidth
&& implicitWidth // WORKAROUND
......@@ -223,7 +227,7 @@ QVariant QmlGraphicsItemNodeInstance::property(const QString &name) const
qmlGraphicsItem()->setWidth(implicitWidth);
}
if (name == "height" && modelNode().isValid()) {
if (name == "height" && modelNode().isValid() && !modelNode().hasBindingProperty("height")) {
double implicitHeight = qmlGraphicsItem()->implicitHeight();
if (!m_hasHeight
&& implicitHeight // WORKAROUND
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment