Fix assert in declarative root context handling
authorKevin Krammer <kevin.krammer@kdab.com>
Fri, 14 Jun 2013 13:05:54 +0000 (15:05 +0200)
committerKevin Krammer <kevin.krammer@kdab.com>
Fri, 14 Jun 2013 13:05:54 +0000 (15:05 +0200)
lib/declarativedeclarativeviewextension.cpp

index 435c7af..6cdd25f 100644 (file)
@@ -60,7 +60,7 @@ void DeclarativeDeclarativeViewExtension::setDeclarativeRootContext(QObject *con
     return;
 
   // we can only set a different wrapper, not replace the view's root context
-  Q_ASSERT(declarativeContext->context() == m_rootContext->context());
+  Q_ASSERT(m_rootContext.isNull() || declarativeContext->context() == m_rootContext->context());
 
   m_rootContext = QPointer<DeclarativeContext>(declarativeContext);
   emit declarativeRootContextChanged();