From b7763c4cfab8df6ae9445f791442c14f1ae739ba Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 3 Dec 2013 14:55:40 +0100 Subject: Release GL resources of ShaderEffectSource while we still have GL. When a Window element is used, the QML window item is deleted before the ShaderEffectSource component and the deleteLater to delete the texture gets handled too late. We now register for the sceneGraphInvalidated signal and release resources synchronously while shutting down. Task-number: QTBUG-35294 Change-Id: Id83b669ddc16723551e5612264ccbad6d3a9bbcb Reviewed-by: Laszlo Agocs Reviewed-by: J-P Nurmi --- src/quick/items/qquickshadereffectsource.cpp | 15 ++++++++++++--- src/quick/items/qquickshadereffectsource_p.h | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index e076a342df..98203c51e5 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -158,16 +158,24 @@ QQuickShaderEffectTexture::QQuickShaderEffectTexture(QQuickItem *shaderSource) QQuickShaderEffectTexture::~QQuickShaderEffectTexture() { - if (m_renderer) - disconnect(m_renderer, SIGNAL(sceneGraphChanged()), this, SLOT(markDirtyTexture())); + invalidated(); +} + +void QQuickShaderEffectTexture::invalidated() +{ delete m_renderer; + m_renderer = 0; delete m_fbo; delete m_secondaryFbo; + m_fbo = m_secondaryFbo = 0; #ifdef QSG_DEBUG_FBO_OVERLAY delete m_debugOverlay; + m_debugOverlay = 0; #endif - if (m_transparentTexture) + if (m_transparentTexture) { glDeleteTextures(1, &m_transparentTexture); + m_transparentTexture = 0; + } } int QQuickShaderEffectTexture::textureId() const @@ -609,6 +617,7 @@ void QQuickShaderEffectSource::ensureTexture() "Cannot be used outside the rendering thread"); m_texture = new QQuickShaderEffectTexture(this); + connect(QQuickItemPrivate::get(this)->window, SIGNAL(sceneGraphInvalidated()), m_texture, SLOT(invalidated()), Qt::DirectConnection); connect(m_texture, SIGNAL(updateRequested()), this, SLOT(update())); connect(m_texture, SIGNAL(scheduledUpdateCompleted()), this, SIGNAL(scheduledUpdateCompleted())); } diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h index 6218775700..efa963fe64 100644 --- a/src/quick/items/qquickshadereffectsource_p.h +++ b/src/quick/items/qquickshadereffectsource_p.h @@ -124,6 +124,7 @@ Q_SIGNALS: public Q_SLOTS: void markDirtyTexture(); + void invalidated(); private: void grab(); -- cgit v1.2.3 From ad03627d142dd002c2c3505f7d75f4c7453cd9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 29 Nov 2013 12:11:48 +0100 Subject: Update changelog for change Icf323618 / QTBUG-35174 Change-Id: Idff1507fdce960ad7dabc2662bb273bc6103c1ca Reviewed-by: Jerome Pasion --- dist/changes-5.2.0 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index b44dc74a5e..fc6de1db3b 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -58,6 +58,14 @@ Third party components currentIndex was set to 0 regardless of the actual number of rows in the model when the model property was changed after the view's initialization. + - QtQuick.Window will now correctly use Window.AutomaticVisibility by + default, analogous to QWindow::show(), resulting in eg. maximized + windows by default on iOS/Android. + + - QtQuick.Window will now warn when setting conflicting visible and visibility + properties, as this use-case is broken with the current QWindow implementation + of the two properties. + **************************************************************************** * Library * **************************************************************************** -- cgit v1.2.3 From 568c575b97940e6afa5015ef2566d8316aa22cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 3 Dec 2013 14:34:05 +0100 Subject: Revert "Load "@2x" images on high-dpi "retina" systems." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 707bbe5dea9d7398b205124a54422f2fafb6f151. By itself this is completely broken and the image will display at twice the size. We need to add code to handle the @2x image but revert for now to get sane behavior. Change-Id: Iccdb26e9d19930b5d0ef4b6c7f596c5766f77a8a Reviewed-by: Tor Arne Vestbø --- src/quick/util/qquickpixmapcache.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 26258fdc5f..082d640ab9 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -1033,17 +1033,6 @@ static QQuickPixmapData* createPixmapDataSync(QQuickPixmap *declarativePixmap, Q if (localFile.isEmpty()) return 0; - // check for "retina" high-dpi and use @2x file if it exixts - if (qApp->devicePixelRatio() > 1) { - const int dotIndex = localFile.lastIndexOf(QLatin1Char('.')); - if (dotIndex != -1) { - QString retinaFile = localFile; - retinaFile.insert(dotIndex, QStringLiteral("@2x")); - if (QFile(retinaFile).exists()) - localFile = retinaFile; - } - } - QFile f(localFile); QSize readSize; QString errorString; -- cgit v1.2.3 From 5006158e4d20ac35d64bc7a581c9966401254002 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 4 Dec 2013 10:20:22 +0100 Subject: Don't leave the GL context current after cleanup. When shutting down, we left the gl context current on the window even when it was hidden. On mac this was a problem as it would optimize away our makeCurrent when the surface was made visible again, leading to nothing being rendered. So we call doneCurrent regardless during invalidateGL(). We also check and verify that makeCurrent in invalidateGL() actually succeeds. This lead to another problem which is that closing the app using [x] will call QWindow::destroy() on all windows, removing their platform windows and causing makeCurrent to fail. To still gracefully clean up resources, we introduced the concept of an offscreen fallback surface which is temporarirly used during the cleanup when needed. The problem is still present on QWindow+QOpenGLContext level, and I've opened QTBUG-35363 to fix this. Task-number: QTBUG-35234 Change-Id: Ie76dbe5fd4ab935db3da34f3ff63d217a3ba5013 Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 52 +++++++++++++++++--------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index acd07cf6cd..d6a3881086 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -205,12 +206,14 @@ public: class WMTryReleaseEvent : public WMWindowEvent { public: - WMTryReleaseEvent(QQuickWindow *win, bool destroy) + WMTryReleaseEvent(QQuickWindow *win, bool destroy, QOffscreenSurface *fallback) : WMWindowEvent(win, WM_TryRelease) , inDestructor(destroy) + , fallbackSurface(fallback) {} bool inDestructor; + QOffscreenSurface *fallbackSurface; }; class WMExposeEvent : public WMWindowEvent @@ -295,7 +298,7 @@ public: delete sgrc; } - void invalidateOpenGL(QQuickWindow *window, bool inDestructor); + void invalidateOpenGL(QQuickWindow *window, bool inDestructor, QOffscreenSurface *backupSurface); void initializeOpenGL(); bool event(QEvent *); @@ -362,17 +365,9 @@ bool QSGRenderThread::event(QEvent *e) case WM_Expose: { QSG_RT_DEBUG("WM_Expose"); WMExposeEvent *se = static_cast(e); - - pendingUpdate |= RepaintRequest; - Q_ASSERT(!window || window == se->window); - + pendingUpdate |= RepaintRequest; windowSize = se->size; - if (window) { - QSG_RT_DEBUG(" - window already added..."); - return true; - } - window = se->window; return true; } @@ -383,7 +378,7 @@ bool QSGRenderThread::event(QEvent *e) mutex.lock(); if (window) { - QSG_RT_DEBUG(" - removed one..."); + QSG_RT_DEBUG(" - removed window..."); window = 0; } waitCondition.wakeOne(); @@ -405,7 +400,7 @@ bool QSGRenderThread::event(QEvent *e) WMTryReleaseEvent *wme = static_cast(e); if (!window || wme->inDestructor) { QSG_RT_DEBUG(" - setting exit flag and invalidating GL"); - invalidateOpenGL(wme->window, wme->inDestructor); + invalidateOpenGL(wme->window, wme->inDestructor, wme->fallbackSurface); active = gl; if (sleeping) stopEventProcessing = true; @@ -453,7 +448,7 @@ bool QSGRenderThread::event(QEvent *e) return QThread::event(e); } -void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor) +void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor, QOffscreenSurface *fallback) { QSG_RT_DEBUG("invalidateOpenGL()"); @@ -469,7 +464,13 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor) bool wipeSG = inDestructor || !window->isPersistentSceneGraph(); bool wipeGL = inDestructor || (wipeSG && !window->isPersistentOpenGLContext()); - gl->makeCurrent(window); + bool current = gl->makeCurrent(fallback ? static_cast(fallback) : static_cast(window)); + if (!current) { +#ifndef QT_NO_DEBUG + qWarning() << "Scene Graph failed to acquire GL context during cleanup"; +#endif + return; + } // The canvas nodes must be cleaned up regardless if we are in the destructor.. if (wipeSG) { @@ -477,6 +478,7 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor) dd->cleanupNodesOnShutdown(); } else { QSG_RT_DEBUG(" - persistent SG, avoiding cleanup"); + gl->doneCurrent(); return; } @@ -510,7 +512,6 @@ void QSGRenderThread::sync() if (windowSize.width() > 0 && windowSize.height() > 0) current = gl->makeCurrent(window); if (current) { - gl->makeCurrent(window); QQuickWindowPrivate *d = QQuickWindowPrivate::get(window); bool hadRenderer = d->renderer != 0; d->syncSceneGraph(); @@ -528,7 +529,6 @@ void QSGRenderThread::sync() QSG_RT_DEBUG(" - window has bad size, waiting..."); } - QSG_RT_DEBUG(" - window has bad size, waiting..."); waitCondition.wakeOne(); mutex.unlock(); } @@ -1036,9 +1036,25 @@ void QSGThreadedRenderLoop::releaseResources(QQuickWindow *window, bool inDestru w->thread->mutex.lock(); if (w->thread->isRunning() && w->thread->active) { + + // The platform window might have been destroyed before + // hide/release/windowDestroyed is called, so we need to have a + // fallback surface to perform the cleanup of the scene graph + // and the OpenGL resources. + // QOffscreenSurface must be created on the GUI thread, so we + // create it here and pass it on to QSGRenderThread::invalidateGL() + QOffscreenSurface *fallback = 0; + if (!window->handle()) { + QSG_GUI_DEBUG(w->window, " - using fallback surface"); + fallback = new QOffscreenSurface(); + fallback->create(); + } + QSG_GUI_DEBUG(w->window, " - posting release request to render thread"); - w->thread->postEvent(new WMTryReleaseEvent(window, inDestructor)); + w->thread->postEvent(new WMTryReleaseEvent(window, inDestructor, fallback)); w->thread->waitCondition.wait(&w->thread->mutex); + + delete fallback; } w->thread->mutex.unlock(); } -- cgit v1.2.3 From d5fd163f325329de5361a3f0018e23ff342d73a1 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 3 Dec 2013 17:25:41 +0100 Subject: Fix binding loop in Maroon in Trouble QML demo Task-number: QTBUG-35210 Change-Id: I44bd9f19acba5b59711aa4ca3d2b12c246afcc59 Reviewed-by: Akseli Salovaara Reviewed-by: Alan Alpert Reviewed-by: Sebastian Wozny --- examples/quick/demos/maroon/maroon.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/quick/demos/maroon/maroon.qml b/examples/quick/demos/maroon/maroon.qml index 34f345f0e7..c6150a5b95 100644 --- a/examples/quick/demos/maroon/maroon.qml +++ b/examples/quick/demos/maroon/maroon.qml @@ -47,7 +47,7 @@ Item { id: root width: 320 height: 480 - property var gameState: Logic.newGameState(canvas); + property var gameState property bool passedSplash: false Image { @@ -230,4 +230,6 @@ Item { transitions: Transition { NumberAnimation { properties: "x,y"; duration: 1200; easing.type: Easing.OutQuad } } + + Component.onCompleted: gameState = Logic.newGameState(canvas); } -- cgit v1.2.3 From 4f08859e812681b67cc197e997102fa81d21ded4 Mon Sep 17 00:00:00 2001 From: Alan Alpert <416365416c@gmail.com> Date: Tue, 3 Dec 2013 08:41:04 -0800 Subject: Revert "Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614" This reverts commit 27052dcad9810869a9065da4c06e9f14379411d7. While the additional flexibility would be nice, I've been reminded that we already did commit to it back in July. Change-Id: Iaf990dda98ee46eb028b4737bdeeafd050d9513f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> --- src/qml/qml/qml.pri | 2 +- src/qml/qml/qqmlabstracturlinterceptor.cpp | 3 -- src/qml/qml/qqmlabstracturlinterceptor.h | 67 ++++++++++++++++++++++++++++ src/qml/qml/qqmlabstracturlinterceptor_p.h | 67 ---------------------------- src/qml/qml/qqmlcompiler.cpp | 2 +- src/qml/qml/qqmlcontext.cpp | 2 +- src/qml/qml/qqmlengine.cpp | 2 +- src/qml/qml/qqmlfileselector.cpp | 2 +- src/qml/qml/qqmlfileselector_p.h | 2 +- src/qml/qml/qqmltypeloader.cpp | 2 +- src/qml/qml/qqmltypeloader_p.h | 2 +- tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 2 +- 12 files changed, 76 insertions(+), 79 deletions(-) create mode 100644 src/qml/qml/qqmlabstracturlinterceptor.h delete mode 100644 src/qml/qml/qqmlabstracturlinterceptor_p.h diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri index f969f5c644..3bba6f8e83 100644 --- a/src/qml/qml/qml.pri +++ b/src/qml/qml/qml.pri @@ -126,7 +126,7 @@ HEADERS += \ $$PWD/qqmlplatform_p.h \ $$PWD/qqmlbinding_p.h \ $$PWD/qqmlextensionplugin_p.h \ - $$PWD/qqmlabstracturlinterceptor_p.h \ + $$PWD/qqmlabstracturlinterceptor.h \ $$PWD/qqmlapplicationengine_p.h \ $$PWD/qqmlapplicationengine.h \ $$PWD/qqmllistwrapper_p.h \ diff --git a/src/qml/qml/qqmlabstracturlinterceptor.cpp b/src/qml/qml/qqmlabstracturlinterceptor.cpp index 321698ad8e..127dad86ce 100644 --- a/src/qml/qml/qqmlabstracturlinterceptor.cpp +++ b/src/qml/qml/qqmlabstracturlinterceptor.cpp @@ -44,9 +44,6 @@ \inmodule QtQml \brief allows you to control QML file loading. - \note This class is not currently public API, due to the risk of being affected - by planned engine changes in upcoming releases. - QQmlAbstractUrlInterceptor is an interface which can be used to alter URLs before they are used by the QML engine. This is primarily useful for altering file urls into other file urls, such as selecting different graphical assets diff --git a/src/qml/qml/qqmlabstracturlinterceptor.h b/src/qml/qml/qqmlabstracturlinterceptor.h new file mode 100644 index 0000000000..4bcaa89b4a --- /dev/null +++ b/src/qml/qml/qqmlabstracturlinterceptor.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLABSTRACTURLINTERCEPTOR_H +#define QQMLABSTRACTURLINTERCEPTOR_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QML_EXPORT QQmlAbstractUrlInterceptor +{ + Q_FLAGS(InterceptionPoint) +public: + enum DataType { //Matches QQmlDataBlob::Type + QmlFile = 0, + JavaScriptFile = 1, + QmldirFile = 2, + UrlString = 0x1000 + }; + + QQmlAbstractUrlInterceptor() {} + virtual ~QQmlAbstractUrlInterceptor() {} + virtual QUrl intercept(const QUrl &path, DataType type) = 0; +}; + +QT_END_NAMESPACE +#endif diff --git a/src/qml/qml/qqmlabstracturlinterceptor_p.h b/src/qml/qml/qqmlabstracturlinterceptor_p.h deleted file mode 100644 index 471c837eed..0000000000 --- a/src/qml/qml/qqmlabstracturlinterceptor_p.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Research In Motion. -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQMLABSTRACTURLINTERCEPTOR_H -#define QQMLABSTRACTURLINTERCEPTOR_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class Q_QML_PRIVATE_EXPORT QQmlAbstractUrlInterceptor -{ - Q_FLAGS(InterceptionPoint) -public: - enum DataType { //Matches QQmlDataBlob::Type - QmlFile = 0, - JavaScriptFile = 1, - QmldirFile = 2, - UrlString = 0x1000 - }; - - QQmlAbstractUrlInterceptor() {} - virtual ~QQmlAbstractUrlInterceptor() {} - virtual QUrl intercept(const QUrl &path, DataType type) = 0; -}; - -QT_END_NAMESPACE -#endif diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 93ec2516c8..187274890b 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -61,7 +61,7 @@ #include "qqmlscriptstring.h" #include "qqmlglobal_p.h" #include "qqmlbinding_p.h" -#include "qqmlabstracturlinterceptor_p.h" +#include "qqmlabstracturlinterceptor.h" #include "qqmlcodegenerator_p.h" #include diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp index 7731935b75..78e6650d02 100644 --- a/src/qml/qml/qqmlcontext.cpp +++ b/src/qml/qml/qqmlcontext.cpp @@ -48,7 +48,7 @@ #include "qqmlengine_p.h" #include "qqmlengine.h" #include "qqmlinfo.h" -#include "qqmlabstracturlinterceptor_p.h" +#include "qqmlabstracturlinterceptor.h" #include #include diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index d082b9a8fd..1320f51d25 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -66,7 +66,7 @@ #include #include #include "qqmlincubator.h" -#include "qqmlabstracturlinterceptor_p.h" +#include "qqmlabstracturlinterceptor.h" #include #include diff --git a/src/qml/qml/qqmlfileselector.cpp b/src/qml/qml/qqmlfileselector.cpp index 7f2007ec00..6ddc2eb2ff 100644 --- a/src/qml/qml/qqmlfileselector.cpp +++ b/src/qml/qml/qqmlfileselector.cpp @@ -40,10 +40,10 @@ ****************************************************************************/ #include +#include #include #include "qqmlfileselector.h" #include "qqmlfileselector_p.h" -#include "qqmlabstracturlinterceptor_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/qml/qml/qqmlfileselector_p.h b/src/qml/qml/qqmlfileselector_p.h index fe3679e08d..501f563ade 100644 --- a/src/qml/qml/qqmlfileselector_p.h +++ b/src/qml/qml/qqmlfileselector_p.h @@ -54,8 +54,8 @@ // #include "qqmlfileselector.h" -#include "qqmlabstracturlinterceptor_p.h" #include +#include #include #include diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 895a2a9cd6..85d2fe41d9 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qqmltypeloader_p.h" -#include "qqmlabstracturlinterceptor_p.h" +#include "qqmlabstracturlinterceptor.h" #include "qqmlcontextwrapper_p.h" #include "qqmlexpression_p.h" diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index c9a5edc39e..b93cf2942d 100644 --- a/src/qml/qml/qqmltypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index 382bfe4b73..004514d39c 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -54,7 +54,7 @@ #include #include #include -#include +#include class tst_qqmlengine : public QQmlDataTest { -- cgit v1.2.3 From 6dbb25f944249f7b846be8b4d77165f054c5483f Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 4 Dec 2013 11:25:13 +0100 Subject: static builds: add classname entry to qmldir for QtQuick.Dialogs.Private MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add classname entry to qmldir, otherwise qmlimportscanner cannot utilize it when doing static builds (on iOS). Task-number: QTBUG-35369 Change-Id: If5440ffcdd805a832d4ff1d129e9f24d222b45d5 Reviewed-by: Morten Johan Sørvig --- src/imports/dialogs-private/qmldir | 1 + 1 file changed, 1 insertion(+) diff --git a/src/imports/dialogs-private/qmldir b/src/imports/dialogs-private/qmldir index e184715519..c371f8bb8c 100644 --- a/src/imports/dialogs-private/qmldir +++ b/src/imports/dialogs-private/qmldir @@ -1,3 +1,4 @@ module QtQuick.Dialogs.Private plugin dialogsprivateplugin typeinfo plugins.qmltypes +classname QtQuick2DialogsPrivatePlugin -- cgit v1.2.3 From 20d2e3faf8b08fb70fdbca586db1d3839af4146a Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 3 Dec 2013 21:47:02 +0100 Subject: QQmlImport: Don't try use a dangling pointer. toUtf8 would return a temporary, and constData would hold a pointer inside that temporary. This isn't even remotely safe. Move the pointer use down to the initializeEngine call so it is kept around long enough for us to do our stuff. This is a backport of cf51cdb8fb002ae3602a4c886e7c67913d77373a. Task-number: QTBUG-35355 Task-number: QTBUG-35343 Change-Id: I338ad7f4d4137445ed9a311a293ea82bf023aafd Reviewed-by: Robin Burchell Reviewed-by: Lars Knoll --- src/qml/qml/qqmlimport.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 30b5abb383..8645d2116a 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1966,8 +1966,7 @@ bool QQmlImportDatabase::importPlugin(const QString &filePath, const QString &ur if (QQmlExtensionInterface *eiface = qobject_cast(instance)) { QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); - const char *moduleId = uri.toUtf8().constData(); - ep->typeLoader.initializeEngine(eiface, moduleId); + ep->typeLoader.initializeEngine(eiface, uri.toUtf8().constData()); } } } -- cgit v1.2.3 From 725118563976bd5abd1c368b90579dbf44462323 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 4 Dec 2013 16:03:59 +0100 Subject: Fix a crash in JSON.parse Properly set members that are actually array indices and don't crash when trying to set those. Task-number: QTBUG-35383 Change-Id: I04d4b65c27e97a2e9db19541ed46ee1bb202f780 Reviewed-by: Simon Hausmann Reviewed-by: Milian Wolff --- src/qml/jsruntime/qv4jsonobject.cpp | 9 +++++++-- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 458b46b36e..5aac8c8197 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -284,8 +284,13 @@ bool JsonParser::parseMember(ObjectRef o) return false; ScopedString s(scope, context->engine->newIdentifier(key)); - Property *p = o->insertMember(s, Attr_Data); - p->value = val.asReturnedValue(); + uint idx = s->asArrayIndex(); + if (idx < UINT_MAX) { + o->putIndexed(idx, val); + } else { + Property *p = o->insertMember(s, Attr_Data); + p->value = val.asReturnedValue(); + } END; return true; diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 39086d75ac..726f8636b6 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -134,6 +134,7 @@ private slots: void reentrancy_Array(); void reentrancy_objectCreation(); void jsIncDecNonObjectProperty(); + void JSONparse(); void qRegExpInport_data(); void qRegExpInport(); @@ -2500,6 +2501,13 @@ void tst_QJSEngine::jsIncDecNonObjectProperty() } } +void tst_QJSEngine::JSONparse() +{ + QJSEngine eng; + QJSValue ret = eng.evaluate("var json=\"{\\\"1\\\": null}\"; JSON.parse(json);"); + QVERIFY(ret.isObject()); +} + static QRegExp minimal(QRegExp r) { r.setMinimal(true); return r; } void tst_QJSEngine::qRegExpInport_data() -- cgit v1.2.3 From 9baa5dac228607c91685bbd74b3f5f069cb374bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 5 Dec 2013 15:22:56 +0100 Subject: Fix broken visibility property assignment after d0644b040e Task-number: QTBUG-35412 Change-Id: I09feca09030a2eb07aa1abebf65481d68b880c79 Reviewed-by: Simon Hausmann --- src/quick/items/qquickwindowmodule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/items/qquickwindowmodule.cpp b/src/quick/items/qquickwindowmodule.cpp index cd1b68991d..44a4bf3db6 100644 --- a/src/quick/items/qquickwindowmodule.cpp +++ b/src/quick/items/qquickwindowmodule.cpp @@ -82,7 +82,7 @@ public: if (!m_complete) m_visibility = visibility; else - QQuickWindow::setVisibility(m_visibility); + QQuickWindow::setVisibility(visibility); } Q_SIGNALS: -- cgit v1.2.3 From f95fdacb3a12e4f0d37d3c32b34326f2bd1536de Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 5 Dec 2013 14:53:27 +0100 Subject: Set the format for the fallback offscreen surface Ie76dbe5fd4ab935db3da34f3ff63d217a3ba5013 fails to set the format for the QOffscreenSurface, resulting in BAD_MATCH failures when trying to make it current. Task-number: QTBUG-35410 Change-Id: I1d420556fad4df96a1893cb3513e398eeb6e71aa Reviewed-by: Lars Knoll --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index d6a3881086..47c2d36d2c 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -1047,6 +1047,7 @@ void QSGThreadedRenderLoop::releaseResources(QQuickWindow *window, bool inDestru if (!window->handle()) { QSG_GUI_DEBUG(w->window, " - using fallback surface"); fallback = new QOffscreenSurface(); + fallback->setFormat(window->requestedFormat()); fallback->create(); } -- cgit v1.2.3