aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-01 16:25:00 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-02 07:24:27 +0000
commitbce843844b8edabc4365d0ef7175b54551217631 (patch)
tree95ff3a7ace875039506e46e47503b6ec0fe4ddd9
parent179d5ec7953f493a119be69be254b699061fd793 (diff)
Fix QQuickPopup::setParentItem()
Don't call naturalControlFont() or calcLocale() with a null pointer, because it will crash. Change-Id: Ib4b6dba85e6c55832c30b5178b74ebf39429a5f8 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
-rw-r--r--src/templates/qquickpopup.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/templates/qquickpopup.cpp b/src/templates/qquickpopup.cpp
index f9cf2f51..36d98813 100644
--- a/src/templates/qquickpopup.cpp
+++ b/src/templates/qquickpopup.cpp
@@ -1176,7 +1176,7 @@ void QQuickPopup::setParentItem(QQuickItem *parent)
d->parentItem = parent;
if (d->positioner.parentItem())
d->positioner.setParentItem(parent);
- if (d->popupItem) {
+ if (parent) {
QQuickControlPrivate::updateFontRecur(d->popupItem, QQuickControlPrivate::naturalControlFont(parent));
QQuickControlPrivate::updateLocaleRecur(d->popupItem, QQuickControlPrivate::calcLocale(parent));
}