diff options
author | Marco Bubke <marco.bubke@nokia.com> | 2011-06-29 19:34:07 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2011-06-30 10:50:22 +0200 |
commit | a49b85eac56907c45eb73ff568409a5d9d5fdd57 (patch) | |
tree | 248c9e9431617583b1f6988a56e06ff766517c4b /share/qtcreator/qml/qmlpuppet/qml2puppet | |
parent | bc6879cbc8118ad1dc3115aa5567de1e818dae30 (diff) | |
download | qt-creator-a49b85eac56907c45eb73ff568409a5d9d5fdd57.tar.gz |
QmlDesigner.NodeInstances: Return the implicit size if the size is invalid
Task-number: QTCREATORBUG-5240
Change-Id: Ie8be3a2cc728805411a79c1f216ede566c641c17
Reviewed-on: http://codereview.qt.nokia.com/925
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/instances/sgitemnodeinstance.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/sgitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/sgitemnodeinstance.cpp index 3b3e7e3e54..acd46e7c16 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/sgitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/sgitemnodeinstance.cpp @@ -271,7 +271,24 @@ bool SGItemNodeInstance::isSGItem() const QSizeF SGItemNodeInstance::size() const { - return QSizeF(sgItem()->width(), sgItem()->height()); + double width; + + if (QSGItemPrivate::get(sgItem())->widthValid) { + width = sgItem()->width(); + } else { + width = sgItem()->implicitWidth(); + } + + double height; + + if (QSGItemPrivate::get(sgItem())->heightValid) { + height = sgItem()->height(); + } else { + height = sgItem()->implicitHeight(); + } + + + return QSizeF(width, height); } QRectF SGItemNodeInstance::boundingRectWithStepChilds(QSGItem *parentItem) const |