From 42ddc80867db8c4f8208d2264f01f535c4458466 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sun, 27 Nov 2011 17:02:24 +0100 Subject: [PATCH] check for scene sxistence --- declarativeimports/core/tooltip.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/declarativeimports/core/tooltip.cpp b/declarativeimports/core/tooltip.cpp index 4eaa5b8fc..118c20cca 100644 --- a/declarativeimports/core/tooltip.cpp +++ b/declarativeimports/core/tooltip.cpp @@ -92,12 +92,12 @@ void ToolTipProxy::syncTarget() return; } - if (!m_declarativeItemContainer) { - m_declarativeItemContainer = QWeakPointer(new DeclarativeItemContainer()); + if (!m_declarativeItemContainer && scene) { + m_declarativeItemContainer = QWeakPointer(new DeclarativeItemContainer()); m_declarativeItemContainer.data()->setObjectName("DIContainer"); scene->addItem(m_declarativeItemContainer.data()); - } - + } + if (m_declarativeItemContainer) { m_target.data()->setObjectName("Original Item"); m_declarativeItemContainer.data()->setDeclarativeItem(item, false); @@ -105,7 +105,7 @@ void ToolTipProxy::syncTarget() m_declarativeItemContainer.data()->setParentItem(m_target.data()); m_widget = m_declarativeItemContainer.data(); emit targetChanged(); - } + } } QString ToolTipProxy::mainText() const