From 9677851febf223cb3e74aa0d11edf95d0c08b919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Thu, 27 Jun 2019 09:47:07 +0300 Subject: Fix simpleqml example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reset source when window changes because it will cause new renderer to be created and it would not have proper source without it. - Update the example codes and resources - Change how the init timer is initialized to get proper result each time the presentation gets reloaded. Task-number: QT3DS-3681 Change-Id: I64d4f6980b87b6efcbb906bb4ad241956ce0a7bc Reviewed-by: Tomi Korpipää Reviewed-by: Miikka Heikkinen --- src/engine/Qt3DSRuntimeView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/engine/Qt3DSRuntimeView.cpp') diff --git a/src/engine/Qt3DSRuntimeView.cpp b/src/engine/Qt3DSRuntimeView.cpp index c1f3b3d..90a2562 100644 --- a/src/engine/Qt3DSRuntimeView.cpp +++ b/src/engine/Qt3DSRuntimeView.cpp @@ -260,6 +260,7 @@ CRuntimeView::~CRuntimeView() bool CRuntimeView::BeginLoad(const QString &sourcePath, const QStringList &variantList) { bool theResult = false; + m_startupTime = -1; // boot up the application BootupPreGraphicsInitObjects(); @@ -372,7 +373,7 @@ void CRuntimeView::Render() m_Application->UpdateAndRender(); - if (m_startupTime < 0 && m_startupTimer) { + if (m_startupTime < 0 && m_startupTimer && m_startupTimer->isValid()) { m_startupTime = m_startupTimer->elapsed(); m_startupTimer->invalidate(); } -- cgit v1.2.3