From: Frederik Gladhorn Date: Tue, 6 Mar 2012 10:26:55 +0000 (+0100) Subject: Check for parent item before calling functions on it. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=73ee7cb72e89ededacf90306f39110f1719e84c9;p=konrad%2Fqtdeclarative.git Check for parent item before calling functions on it. Change-Id: Ic4066d133ef16ce8cf11fcb9fb5ddcc19599e85d Reviewed-by: Jan-Arve Sæther --- diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.cpp b/src/plugins/accessible/quick/qaccessiblequickitem.cpp index 78e7ca8..6c13377 100644 --- a/src/plugins/accessible/quick/qaccessiblequickitem.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickitem.cpp @@ -278,7 +278,7 @@ QRect itemScreenRect(QQuickItem *item) // parent size. WE MIGHT HAVE TO REVISIT THESE FALLBACKS. if (itemSize.isEmpty()) { itemSize = QSize((int)item->implicitWidth(), (int)item->implicitHeight()); - if (itemSize.isEmpty()) + if (itemSize.isEmpty() && item->parentItem()) // ### Seems that the above fallback is not enough, fallback to use the parent size... itemSize = QSize((int)item->parentItem()->width(), (int)item->parentItem()->height()); }