Commit 7a1e19d8 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.nodeInstances: fix for implicit width

Reviewed-by: Marco Bubke
parent 0ffe949e
...@@ -118,6 +118,7 @@ QSizeF QmlGraphicsItemNodeInstance::size() const ...@@ -118,6 +118,7 @@ QSizeF QmlGraphicsItemNodeInstance::size() const
double implicitWidth = qmlGraphicsItem()->implicitWidth(); double implicitWidth = qmlGraphicsItem()->implicitWidth();
if (!m_hasWidth if (!m_hasWidth
&& implicitWidth // WORKAROUND && implicitWidth // WORKAROUND
&& qmlGraphicsItem()->width() <= 0
&& implicitWidth != qmlGraphicsItem()->width() && implicitWidth != qmlGraphicsItem()->width()
&& !hasBindingForProperty("width")) { && !hasBindingForProperty("width")) {
qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->blockSignals(true);
...@@ -128,6 +129,7 @@ QSizeF QmlGraphicsItemNodeInstance::size() const ...@@ -128,6 +129,7 @@ QSizeF QmlGraphicsItemNodeInstance::size() const
double implicitHeight = qmlGraphicsItem()->implicitHeight(); double implicitHeight = qmlGraphicsItem()->implicitHeight();
if (!m_hasHeight if (!m_hasHeight
&& implicitWidth // WORKAROUND && implicitWidth // WORKAROUND
&& qmlGraphicsItem()->height() <= 0
&& implicitHeight != qmlGraphicsItem()->height() && implicitHeight != qmlGraphicsItem()->height()
&& !hasBindingForProperty("height")) { && !hasBindingForProperty("height")) {
qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->blockSignals(true);
...@@ -162,6 +164,7 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const ...@@ -162,6 +164,7 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const
double implicitWidth = qmlGraphicsItem()->implicitWidth(); double implicitWidth = qmlGraphicsItem()->implicitWidth();
if (!m_hasWidth if (!m_hasWidth
&& implicitWidth // WORKAROUND && implicitWidth // WORKAROUND
&& qmlGraphicsItem()->width() <= 0
&& implicitWidth != qmlGraphicsItem()->width() && implicitWidth != qmlGraphicsItem()->width()
&& !hasBindingForProperty("width")) { && !hasBindingForProperty("width")) {
qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->blockSignals(true);
...@@ -172,6 +175,7 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const ...@@ -172,6 +175,7 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const
double implicitHeight = qmlGraphicsItem()->implicitHeight(); double implicitHeight = qmlGraphicsItem()->implicitHeight();
if (!m_hasHeight if (!m_hasHeight
&& implicitWidth // WORKAROUND && implicitWidth // WORKAROUND
&& qmlGraphicsItem()->height() <= 0
&& implicitHeight != qmlGraphicsItem()->height() && implicitHeight != qmlGraphicsItem()->height()
&& !hasBindingForProperty("height")) { && !hasBindingForProperty("height")) {
qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->blockSignals(true);
...@@ -249,6 +253,7 @@ QVariant QmlGraphicsItemNodeInstance::property(const QString &name) const ...@@ -249,6 +253,7 @@ QVariant QmlGraphicsItemNodeInstance::property(const QString &name) const
double implicitWidth = qmlGraphicsItem()->implicitWidth(); double implicitWidth = qmlGraphicsItem()->implicitWidth();
if (!m_hasWidth if (!m_hasWidth
&& implicitWidth // WORKAROUND && implicitWidth // WORKAROUND
&& qmlGraphicsItem()->width() <= 0
&& implicitWidth != qmlGraphicsItem()->width()) { && implicitWidth != qmlGraphicsItem()->width()) {
qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->blockSignals(true);
qmlGraphicsItem()->setWidth(implicitWidth); qmlGraphicsItem()->setWidth(implicitWidth);
...@@ -260,6 +265,7 @@ QVariant QmlGraphicsItemNodeInstance::property(const QString &name) const ...@@ -260,6 +265,7 @@ QVariant QmlGraphicsItemNodeInstance::property(const QString &name) const
double implicitHeight = qmlGraphicsItem()->implicitHeight(); double implicitHeight = qmlGraphicsItem()->implicitHeight();
if (!m_hasHeight if (!m_hasHeight
&& implicitHeight // WORKAROUND && implicitHeight // WORKAROUND
&& qmlGraphicsItem()->width() <= 0
&& implicitHeight != qmlGraphicsItem()->height()) { && implicitHeight != qmlGraphicsItem()->height()) {
qmlGraphicsItem()->blockSignals(true); qmlGraphicsItem()->blockSignals(true);
qmlGraphicsItem()->setHeight(implicitHeight); qmlGraphicsItem()->setHeight(implicitHeight);
......
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