forked from qt-creator/qt-creator
QmlDesigner.nodeInstances: fix for implicit width
Reviewed-by: Marco Bubke
This commit is contained in:
@@ -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
|
|||||||
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
|
|||||||
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
|
|||||||
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
|
|||||||
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
|
|||||||
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);
|
||||||
|
Reference in New Issue
Block a user