From 3d389f2a47dad538925ca1916e889c4bbc48fbac Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Wed, 5 Nov 2014 10:57:45 +0100 Subject: Documentation: Update QtQuick import value to 2.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are new APIs in Qt 5.4, the import version needed is 2.4. Change-Id: I1c52c6a50362f539670d9ad00e03e57208234a17 Reviewed-by: J-P Nurmi Reviewed-by: Topi Reiniö --- src/quick/doc/src/qmltypereference.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index 4d3341aac4..cc602d4aee 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! -\qmlmodule QtQuick 2.3 +\qmlmodule QtQuick 2.4 \title Qt Quick QML Types \ingroup qmlmodules \brief Provides graphical QML types. @@ -34,11 +34,11 @@ The \l{Qt Quick} module provides graphical primitive types. These types are only available in a QML document if that document imports the \c QtQuick namespace. -The current version of the \c QtQuick module is version 2.3, and thus it may be +The current version of the \c QtQuick module is version 2.4, and thus it may be imported via the following statement: \qml -import QtQuick 2.3 +import QtQuick 2.4 \endqml Visit the \l {Qt Quick} module documentation for more -- cgit v1.2.3 From ebc342ea38b4a5d2e3b83a47f375fa1737acaf49 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 5 Nov 2014 13:35:12 +0100 Subject: Add a debug function to save contents of distance field cache Just copy the one from QSGSharedDistanceFieldCache with some compile fixes to the superclass so we store the default cache as well. Change-Id: I1fcc390601eea58f8b7729c9cead418e4c94714c Reviewed-by: Yoann Lopes --- src/quick/scenegraph/qsgadaptationlayer.cpp | 170 ++++++++++++++++++++ src/quick/scenegraph/qsgadaptationlayer_p.h | 4 + .../qsgshareddistancefieldglyphcache.cpp | 173 --------------------- src/quick/scenegraph/scenegraph.pri | 1 + 4 files changed, 175 insertions(+), 173 deletions(-) diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index 80234d54f5..9e4b572ea6 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -174,6 +174,11 @@ void QSGDistanceFieldGlyphCache::update() storeGlyphs(distanceFields); +#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG) + foreach (Texture texture, m_textures) + saveTexture(texture.textureId, texture.size.width(), texture.size.height()); +#endif + if (QSG_LOG_TIME_GLYPH().isDebugEnabled()) { quint64 now = qsg_render_timer.elapsed(); qCDebug(QSG_LOG_TIME_GLYPH, @@ -284,6 +289,171 @@ void QSGDistanceFieldGlyphCache::updateTexture(GLuint oldTex, GLuint newTex, con } } +#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG) +#include + +void QSGDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int height) const +{ + GLuint fboId; + glGenFramebuffers(1, &fboId); + + GLuint tmpTexture = 0; + glGenTextures(1, &tmpTexture); + glBindTexture(GL_TEXTURE_2D, tmpTexture); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glBindTexture(GL_TEXTURE_2D, 0); + + glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId); + glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, + tmpTexture, 0); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, textureId); + + glDisable(GL_STENCIL_TEST); + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_BLEND); + + GLfloat textureCoordinateArray[8]; + textureCoordinateArray[0] = 0.0f; + textureCoordinateArray[1] = 0.0f; + textureCoordinateArray[2] = 1.0f; + textureCoordinateArray[3] = 0.0f; + textureCoordinateArray[4] = 1.0f; + textureCoordinateArray[5] = 1.0f; + textureCoordinateArray[6] = 0.0f; + textureCoordinateArray[7] = 1.0f; + + GLfloat vertexCoordinateArray[8]; + vertexCoordinateArray[0] = -1.0f; + vertexCoordinateArray[1] = -1.0f; + vertexCoordinateArray[2] = 1.0f; + vertexCoordinateArray[3] = -1.0f; + vertexCoordinateArray[4] = 1.0f; + vertexCoordinateArray[5] = 1.0f; + vertexCoordinateArray[6] = -1.0f; + vertexCoordinateArray[7] = 1.0f; + + glViewport(0, 0, width, height); + glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray); + glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray); + + { + static const char *vertexShaderSource = + "attribute vec4 vertexCoordsArray; \n" + "attribute vec2 textureCoordArray; \n" + "varying vec2 textureCoords; \n" + "void main(void) \n" + "{ \n" + " gl_Position = vertexCoordsArray; \n" + " textureCoords = textureCoordArray; \n" + "} \n"; + + static const char *fragmentShaderSource = + "varying vec2 textureCoords; \n" + "uniform sampler2D texture; \n" + "void main() \n" + "{ \n" + " gl_FragColor = texture2D(texture, textureCoords); \n" + "} \n"; + + GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); + GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); + + if (vertexShader == 0 || fragmentShader == 0) { + GLenum error = glGetError(); + qWarning("SharedGraphicsCacheServer::setupShaderPrograms: Failed to create shaders. (GL error: %x)", + error); + return; + } + + glShaderSource(vertexShader, 1, &vertexShaderSource, NULL); + glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL); + glCompileShader(vertexShader); + + GLint len = 1; + glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &len); + + char infoLog[2048]; + glGetShaderInfoLog(vertexShader, 2048, NULL, infoLog); + if (qstrlen(infoLog) > 0) { + qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling vertex shader:\n %s", + infoLog); + } + + glCompileShader(fragmentShader); + glGetShaderInfoLog(fragmentShader, 2048, NULL, infoLog); + if (qstrlen(infoLog) > 0) { + qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling fragent shader:\n %s", + infoLog); + } + + GLuint shaderProgram = glCreateProgram(); + glAttachShader(shaderProgram, vertexShader); + glAttachShader(shaderProgram, fragmentShader); + + glBindAttribLocation(shaderProgram, 0, "vertexCoordsArray"); + glBindAttribLocation(shaderProgram, 1, "textureCoordArray"); + + glLinkProgram(shaderProgram); + glGetProgramInfoLog(shaderProgram, 2048, NULL, infoLog); + if (qstrlen(infoLog) > 0) { + qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems linking shaders:\n %s", + infoLog); + } + + glUseProgram(shaderProgram); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + + int textureUniformLocation = glGetUniformLocation(shaderProgram, "texture"); + glUniform1i(textureUniformLocation, 0); + } + + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + + { + GLenum error = glGetError(); + if (error != GL_NO_ERROR) { + qWarning("SharedGraphicsCacheServer::readBackBuffer: glDrawArrays reported error 0x%x", + error); + } + } + + uchar *data = new uchar[width * height * 4]; + + glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); + + QImage image(data, width, height, QImage::Format_ARGB32); + + QByteArray fileName = m_referenceFont.familyName().toLatin1() + '_' + QByteArray::number(textureId); + fileName = fileName.replace('/', '_').replace(' ', '_') + ".png"; + + image.save(QString::fromLocal8Bit(fileName)); + + { + GLenum error = glGetError(); + if (error != GL_NO_ERROR) { + qWarning("SharedGraphicsCacheServer::readBackBuffer: glReadPixels reported error 0x%x", + error); + } + } + + glDisableVertexAttribArray(0); + glDisableVertexAttribArray(1); + + glDeleteFramebuffers(1, &fboId); + glDeleteTextures(1, &tmpTexture); + + delete[] data; +} +#endif + void QSGNodeVisitorEx::visitChildren(QSGNode *node) { for (QSGNode *child = node->firstChild(); child; child = child->nextSibling()) { diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h index a63299fcde..962fc5a98a 100644 --- a/src/quick/scenegraph/qsgadaptationlayer_p.h +++ b/src/quick/scenegraph/qsgadaptationlayer_p.h @@ -357,6 +357,10 @@ protected: GlyphData &glyphData(glyph_t glyph); +#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG) + void saveTexture(GLuint textureId, int width, int height) const; +#endif + inline bool isCoreProfile() const { return m_coreProfile; } private: diff --git a/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp index 6f54b258ff..f635ccd17b 100644 --- a/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp @@ -399,176 +399,6 @@ void QSGSharedDistanceFieldGlyphCache::unregisterOwnerElement(QQuickItem *ownerE } } -#if defined(QSGSHAREDDISTANCEFIELDGLYPHCACHE_DEBUG_) -# include - -void QSGSharedDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int height) -{ - GLuint fboId; - glGenFramebuffers(1, &fboId); - - GLuint tmpTexture = 0; - glGenTextures(1, &tmpTexture); - glBindTexture(GL_TEXTURE_2D, tmpTexture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindTexture(GL_TEXTURE_2D, 0); - - glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId); - glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, - tmpTexture, 0); - - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, textureId); - - glDisable(GL_STENCIL_TEST); - glDisable(GL_DEPTH_TEST); - glDisable(GL_SCISSOR_TEST); - glDisable(GL_BLEND); - - GLfloat textureCoordinateArray[8]; - textureCoordinateArray[0] = 0.0f; - textureCoordinateArray[1] = 0.0f; - textureCoordinateArray[2] = 1.0f; - textureCoordinateArray[3] = 0.0f; - textureCoordinateArray[4] = 1.0f; - textureCoordinateArray[5] = 1.0f; - textureCoordinateArray[6] = 0.0f; - textureCoordinateArray[7] = 1.0f; - - GLfloat vertexCoordinateArray[8]; - vertexCoordinateArray[0] = -1.0f; - vertexCoordinateArray[1] = -1.0f; - vertexCoordinateArray[2] = 1.0f; - vertexCoordinateArray[3] = -1.0f; - vertexCoordinateArray[4] = 1.0f; - vertexCoordinateArray[5] = 1.0f; - vertexCoordinateArray[6] = -1.0f; - vertexCoordinateArray[7] = 1.0f; - - glViewport(0, 0, width, height); - glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray); - - { - static const char vertexShaderSource[] = - "attribute highp vec4 vertexCoordsArray; \n" - "attribute highp vec2 textureCoordArray; \n" - "varying highp vec2 textureCoords; \n" - "void main(void) \n" - "{ \n" - " gl_Position = vertexCoordsArray; \n" - " textureCoords = textureCoordArray; \n" - "} \n"; - - static const char fragmentShaderSource[] = - "varying highp vec2 textureCoords; \n" - "uniform sampler2D texture; \n" - "void main() \n" - "{ \n" - " gl_FragColor = texture2D(texture, textureCoords); \n" - "} \n"; - - GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); - GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); - - if (vertexShader == 0 || fragmentShader == 0) { - GLenum error = glGetError(); - qWarning("SharedGraphicsCacheServer::setupShaderPrograms: Failed to create shaders. (GL error: %x)", - error); - return; - } - - glShaderSource(vertexShader, 1, &vertexShaderSource, NULL); - glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL); - glCompileShader(vertexShader); - - GLint len = 1; - glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &len); - - char infoLog[2048]; - glGetShaderInfoLog(vertexShader, 2048, NULL, infoLog); - if (qstrlen(infoLog) > 0) { - qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling vertex shader:\n %s", - infoLog); - //return; - } - - glCompileShader(fragmentShader); - glGetShaderInfoLog(fragmentShader, 2048, NULL, infoLog); - if (qstrlen(infoLog) > 0) { - qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling fragent shader:\n %s", - infoLog); - //return; - } - - GLuint shaderProgram = glCreateProgram(); - glAttachShader(shaderProgram, vertexShader); - glAttachShader(shaderProgram, fragmentShader); - - glBindAttribLocation(shaderProgram, 0, "vertexCoordsArray"); - glBindAttribLocation(shaderProgram, 1, "textureCoordArray"); - - glLinkProgram(shaderProgram); - glGetProgramInfoLog(shaderProgram, 2048, NULL, infoLog); - if (qstrlen(infoLog) > 0) { - qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems linking shaders:\n %s", - infoLog); - //return; - } - - glUseProgram(shaderProgram); - glEnableVertexAttribArray(0); - glEnableVertexAttribArray(1); - - int textureUniformLocation = glGetUniformLocation(shaderProgram, "_qt_texture"); - glUniform1i(textureUniformLocation, 0); - } - - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - { - GLenum error = glGetError(); - if (error != GL_NO_ERROR) { - qWarning("SharedGraphicsCacheServer::readBackBuffer: glDrawArrays reported error 0x%x", - error); - } - } - - uchar *data = new uchar[width * height * 4]; - - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); - - QImage image(width, height, QImage::Format_ARGB32); - quint32 *dest = reinterpret_cast(image.bits()); - for (int i=0; itextureIdForBuffer(it.key()); texture.size = m_sharedGraphicsCache->sizeOfBuffer(it.key()); -#if defined(QSGSHAREDDISTANCEFIELDGLYPHCACHE_DEBUG_) - saveTexture(texture.textureId, texture.size.width(), texture.size.height()); -#endif setGlyphsTexture(it.value().glyphs, texture); ++it; diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri index bcb523f90d..480ac5e569 100644 --- a/src/quick/scenegraph/scenegraph.pri +++ b/src/quick/scenegraph/scenegraph.pri @@ -1,6 +1,7 @@ !contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL # DEFINES += QSG_SEPARATE_INDEX_BUFFER +# DEFINES += QSG_DISTANCEFIELD_CACHE_DEBUG # Core API HEADERS += \ -- cgit v1.2.3 From 5280e866f76e38f2bf1c226ff896b4649194eec4 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 5 Nov 2014 14:02:55 +0100 Subject: Mark cleanup function as unused if compiled with QT_QML_NO_DEBUGGER The static cleanup function in qqmldebugserver.cpp is only used if the debug server is actually created. If not we can mark it as unused to avoid compile warnings. Enclosing it in #ifdef would be uglier. Task-number: QTBUG-42394 Change-Id: Ieb7fa38ecb346e80ce815ced85eb3a168bad9d99 Reviewed-by: Simon Hausmann --- src/qml/debugger/qqmldebugserver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp index 59ac548fa8..2a2ce663bc 100644 --- a/src/qml/debugger/qqmldebugserver.cpp +++ b/src/qml/debugger/qqmldebugserver.cpp @@ -419,6 +419,7 @@ QQmlDebugServer::QQmlDebugServer() } } #else + Q_UNUSED(&cleanup) if (!appD->qmljsDebugArgumentsString().isEmpty()) { qWarning() << QString(QLatin1String( "QML Debugger: Ignoring \"-qmljsdebugger=%1\". " -- cgit v1.2.3 From 77711c65c1fdb6c5d94d26fef828959d29643516 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 3 Nov 2014 17:23:11 +0100 Subject: Add attached Window::contentItem property This is essential to the Qt Quick Controls for implementing floating text selection handle popups. Change-Id: Ibae65110a5db6d65dacd197fef3ad567d11342dc Reviewed-by: Alan Alpert Reviewed-by: Shawn Rutledge --- src/quick/items/qquickwindow.cpp | 8 ++++++++ src/quick/items/qquickwindowattached.cpp | 6 ++++++ src/quick/items/qquickwindowattached_p.h | 3 +++ tests/auto/quick/qquickwindow/data/windowattached.qml | 2 ++ tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 2 ++ 5 files changed, 21 insertions(+) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index f6c1412aff..619e539204 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1250,6 +1250,14 @@ bool QQuickWindow::isPersistentSceneGraph() const +/*! + \qmlattachedproperty Item Window::contentItem + \since 5.4 + + This attached property holds the invisible root item of the scene or + \c null if the item is not in a window. The Window attached property + can be attached to any Item. +*/ /*! \property QQuickWindow::contentItem diff --git a/src/quick/items/qquickwindowattached.cpp b/src/quick/items/qquickwindowattached.cpp index 121da9e5d9..f74e903be3 100644 --- a/src/quick/items/qquickwindowattached.cpp +++ b/src/quick/items/qquickwindowattached.cpp @@ -65,6 +65,11 @@ QQuickItem *QQuickWindowAttached::activeFocusItem() const return (m_window ? m_window->activeFocusItem() : Q_NULLPTR); } +QQuickItem *QQuickWindowAttached::contentItem() const +{ + return (m_window ? m_window->contentItem() : Q_NULLPTR); +} + void QQuickWindowAttached::windowChanged(QQuickWindow *window) { if (window != m_window) { @@ -83,6 +88,7 @@ void QQuickWindowAttached::windowChanged(QQuickWindow *window) emit activeChanged(); if (!oldWindow || window->activeFocusItem() != oldWindow->activeFocusItem()) emit activeFocusItemChanged(); + emit contentItemChanged(); // QQuickWindowQmlImpl::visibilityChanged also exists, and window might even // be QQuickWindowQmlImpl, but that's not what we are connecting to. diff --git a/src/quick/items/qquickwindowattached_p.h b/src/quick/items/qquickwindowattached_p.h index 12dd273d60..7c2b0bc873 100644 --- a/src/quick/items/qquickwindowattached_p.h +++ b/src/quick/items/qquickwindowattached_p.h @@ -49,6 +49,7 @@ class Q_AUTOTEST_EXPORT QQuickWindowAttached : public QObject Q_PROPERTY(QWindow::Visibility visibility READ visibility NOTIFY visibilityChanged) Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) Q_PROPERTY(QQuickItem* activeFocusItem READ activeFocusItem NOTIFY activeFocusItemChanged) + Q_PROPERTY(QQuickItem* contentItem READ contentItem NOTIFY contentItemChanged) public: QQuickWindowAttached(QObject* attachee); @@ -56,12 +57,14 @@ public: QWindow::Visibility visibility() const; bool isActive() const; QQuickItem* activeFocusItem() const; + QQuickItem* contentItem() const; Q_SIGNALS: void visibilityChanged(); void activeChanged(); void activeFocusItemChanged(); + void contentItemChanged(); protected Q_SLOTS: void windowChanged(QQuickWindow*); diff --git a/tests/auto/quick/qquickwindow/data/windowattached.qml b/tests/auto/quick/qquickwindow/data/windowattached.qml index e000d5c6fd..0e3f1d4b62 100644 --- a/tests/auto/quick/qquickwindow/data/windowattached.qml +++ b/tests/auto/quick/qquickwindow/data/windowattached.qml @@ -6,6 +6,7 @@ Rectangle { width: 100 height: 100 property bool windowActive: root.Window.active + property Item contentItem: root.Window.contentItem Text { objectName: "rectangleWindowText" anchors.centerIn: parent @@ -20,6 +21,7 @@ Rectangle { objectName: "extraWindowText" anchors.centerIn: parent text: (extraWindow.active ? "active" : "inactive") + "\nvisibility: " + Window.visibility + property Item contentItem: Window.contentItem } } } diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 5bd7492d70..043203c256 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -1952,6 +1952,7 @@ void tst_qquickwindow::attachedProperty() view.requestActivate(); QVERIFY(QTest::qWaitForWindowActive(&view)); QVERIFY(view.rootObject()->property("windowActive").toBool()); + QCOMPARE(view.rootObject()->property("contentItem").value(), view.contentItem()); QQuickWindow *innerWindow = view.rootObject()->findChild("extraWindow"); QVERIFY(innerWindow); @@ -1961,6 +1962,7 @@ void tst_qquickwindow::attachedProperty() QQuickText *text = view.rootObject()->findChild("extraWindowText"); QVERIFY(text); QCOMPARE(text->text(), QLatin1String("active\nvisibility: 2")); + QCOMPARE(text->property("contentItem").value(), innerWindow->contentItem()); } class RenderJob : public QRunnable -- cgit v1.2.3 From b74268ef3e82f0fb9c1ed5392efd0e19c08ee5d5 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Wed, 5 Nov 2014 11:27:15 +0100 Subject: qv4: assign split of edges to loop header to the correct group (i.e assign split edges to the correct loop group, now for real) The fix of 25b6fae1eb26645a30b3e7e254ce0b585757351c did try fix QTBUG-41766 and simplify the logic to assign the inserted statement to a loop group. Unfortunately that was incorrect if the target basic block starts a group. In that case if the source was already inside the group we should add it to the target basic block, otherwise to the one containing the target block (as before). There was no visible regression caused by this. Change-Id: Id50c42305fc5ac6aedaffa89d8f8dc3b5e976aa4 Task-number: QTBUG-41766 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4ssa.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index 31e3ed867e..d2222a0458 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -2991,7 +2991,19 @@ void splitCriticalEdges(IR::Function *f, DominatorTree &df, StatementWorklist &w toBB->in[inIdx] = newBB; newBB->out.append(toBB); - newBB->setContainingGroup(toBB->containingGroup()); + // add newBB to the correct loop group + if (toBB->isGroupStart()) { + BasicBlock *container; + for (container = fromBB->containingGroup(); container; container = container->containingGroup()) + if (container == toBB) + break; + if (container == toBB) // if we were already inside the toBB loop + newBB->setContainingGroup(toBB); + else + newBB->setContainingGroup(toBB->containingGroup()); + } else { + newBB->setContainingGroup(toBB->containingGroup()); + } // patch the terminator Stmt *terminator = fromBB->terminator(); -- cgit v1.2.3 From e703f4170e851da50fad14df9fdd5a923bacf7e8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Nov 2014 09:22:11 +0100 Subject: Initialize member variable QSGAnimationDriver::m_lag. Fixes purify warning: [W] UMR: Uninitialized memory read in QSGAnimationDriver::advance(void) {1 occurrence} QSGAnimationDriver::advance(void) [qtdeclarative\src\quick\scenegraph\qsgcontext.cpp:221] Task-number: QTBUG-42213 Change-Id: Ide35830c60c5935644747da5cfbad1cdbd357232 Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/qsgcontext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index b5bdbde3ad..90102f1110 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -161,6 +161,7 @@ public: , m_time(0) , m_vsync(0) , m_mode(VSyncMode) + , m_lag(0) , m_bad(0) , m_good(0) { -- cgit v1.2.3 From 61dd293a145a3881c6ff4a223121f655f1f8d0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Thu, 6 Nov 2014 10:53:49 +0100 Subject: Stabilize tst_QQuickAccessible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no reason to wait for the window to activate Task-number: QTBUG-42355 Change-Id: I5faaff5bddd367e6dd57a6a922011c87c847148e Reviewed-by: Tony Sarajärvi --- tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp index 921c81ae89..f6d5d16605 100644 --- a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp +++ b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp @@ -383,8 +383,6 @@ void tst_QQuickAccessible::checkableTest() QScopedPointer window(new QQuickView()); window->setSource(testFileUrl("checkbuttons.qml")); window->show(); - window->requestActivate(); - QVERIFY(QTest::qWaitForWindowActive(window.data())); QQuickItem *contentItem = window->contentItem(); QVERIFY(contentItem); @@ -462,8 +460,6 @@ void tst_QQuickAccessible::ignoredTest() QScopedPointer window(new QQuickView()); window->setSource(testFileUrl("ignored.qml")); window->show(); - window->requestActivate(); - QVERIFY(QTest::qWaitForWindowActive(window.data())); QQuickItem *contentItem = window->contentItem(); QVERIFY(contentItem); -- cgit v1.2.3 From a4877338826381d454dfdae74242a007b3aac9e0 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 6 Nov 2014 14:40:37 +0100 Subject: Avoid stack overflow when destroying InternalClass If there are deep object hierarchies connected to an InternalClass the recursive nature of the destroy() method could lead to a stack overflow. By changing the recursion into an iteration this is avoided. Change-Id: I6667f268a366749c2dbc5f7147882388f192a9c5 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4internalclass.cpp | 35 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp index a59c3892a1..bb22e30ac1 100644 --- a/src/qml/jsruntime/qv4internalclass.cpp +++ b/src/qml/jsruntime/qv4internalclass.cpp @@ -412,25 +412,24 @@ InternalClass *InternalClass::frozen() void InternalClass::destroy() { - if (!engine) - return; - engine = 0; - - propertyTable.~PropertyHash(); - nameMap.~SharedInternalClassData(); - propertyData.~SharedInternalClassData(); + QList destroyStack; + destroyStack.append(this); - if (m_sealed) - m_sealed->destroy(); - - if (m_frozen) - m_frozen->destroy(); - - for (QHash::ConstIterator it = transitions.begin(), end = transitions.end(); - it != end; ++it) - it.value()->destroy(); - - transitions.clear(); + while (!destroyStack.isEmpty()) { + InternalClass *next = destroyStack.takeLast(); + if (!next->engine) + continue; + next->engine = 0; + next->propertyTable.~PropertyHash(); + next->nameMap.~SharedInternalClassData(); + next->propertyData.~SharedInternalClassData(); + if (next->m_sealed) + destroyStack.append(next->m_sealed); + if (next->m_frozen) + destroyStack.append(next->m_frozen); + destroyStack.append(next->transitions.values()); + next->transitions.clear(); + } } struct InternalClassPoolVisitor -- cgit v1.2.3 From efa81f8354f70d99e6341ffa5428495b28e68641 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 6 Nov 2014 11:43:19 +0100 Subject: Inspector: Do not assert when trying to stream QModelIndex Some QVariant's like QModelIndex cannot be streamed in a meaningful way: QDataType::save() will return false for them. However, this leads to a qWarning and Q_ASSERT in QVariant::operator<<(). To prevent this we're calling QDataType::save() manually beforehand. We however throw away the result if it succeeds, and still call QVariant::operator<<() to get the benefits of the QDataStream version handling. The alternatives would be to make QVariant::operator<<() not assert, or blacklist all known types with problems manually. Both seem to be difficult though ... Change-Id: I4f5fe6d5a3a076c24fbc73371a4d12d720de53da Task-number: QTBUG-42438 Reviewed-by: Ulf Hermann Reviewed-by: Simon Hausmann --- src/qml/debugger/qqmlenginedebugservice.cpp | 12 +++++-- .../tst_qqmlenginedebugservice.cpp | 40 +++++++++++++++++++++- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/qml/debugger/qqmlenginedebugservice.cpp b/src/qml/debugger/qqmlenginedebugservice.cpp index cb533a0459..088f3203d6 100644 --- a/src/qml/debugger/qqmlenginedebugservice.cpp +++ b/src/qml/debugger/qqmlenginedebugservice.cpp @@ -96,8 +96,16 @@ QDataStream &operator>>(QDataStream &ds, QDataStream &operator<<(QDataStream &ds, const QQmlEngineDebugService::QQmlObjectProperty &data) { - ds << (int)data.type << data.name << data.value << data.valueTypeName - << data.binding << data.hasNotifySignal; + ds << (int)data.type << data.name; + // check first whether the data can be saved + // (otherwise we assert in QVariant::operator<<) + QByteArray buffer; + QDataStream fakeStream(&buffer, QIODevice::WriteOnly); + if (QMetaType::save(fakeStream, data.value.type(), data.value.constData())) + ds << data.value; + else + ds << QVariant(); + ds << data.valueTypeName << data.binding << data.hasNotifySignal; return ds; } diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp index 5bbbe8e1e9..7c931928d4 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -73,6 +74,16 @@ signals: }; QML_DECLARE_TYPE(NonScriptProperty) +class CustomTypes : public QObject +{ + Q_OBJECT + Q_PROPERTY(QModelIndex modelIndex READ modelIndex) +public: + CustomTypes(QObject *parent = 0) : QObject(parent) {} + + QModelIndex modelIndex() { return QModelIndex(); } +}; + class tst_QQmlEngineDebugService : public QObject { Q_OBJECT @@ -125,6 +136,7 @@ private slots: void setBindingInStates(); void regression_QTCREATORBUG_7451(); + void queryObjectWithNonStreamableTypes(); }; QmlDebugObjectReference tst_QQmlEngineDebugService::findRootObject( @@ -314,6 +326,12 @@ void tst_QQmlEngineDebugService::initTestCase() "}\n" ; + // test non-streamable properties + qmlRegisterType("Backend", 1, 0, "CustomTypes"); + qml << "import Backend 1.0\n" + "CustomTypes {}" + ; + for (int i=0; i= 0); QCOMPARE(context.contexts[0].name, QString("tst_QQmlDebug_childContext")); } @@ -819,6 +837,26 @@ void tst_QQmlEngineDebugService::regression_QTCREATORBUG_7451() } } +void tst_QQmlEngineDebugService::queryObjectWithNonStreamableTypes() +{ + bool success; + + QmlDebugObjectReference rootObject = findRootObject(4, true); + + QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0); + unconnected->queryObject(rootObject, &success); + QVERIFY(!success); + delete unconnected; + + m_dbg->queryObject(rootObject, &success); + QVERIFY(success); + QVERIFY(QQmlDebugTest::waitForSignal(m_dbg, SIGNAL(result()))); + + QmlDebugObjectReference obj = m_dbg->object(); + + QCOMPARE(findProperty(obj.properties, "modelIndex").value, QVariant()); +} + void tst_QQmlEngineDebugService::queryExpressionResult() { -- cgit v1.2.3 From 911b940c97e88dd9769d4831807e132706c38125 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 6 Nov 2014 11:35:35 +0100 Subject: Debug: Make it possible to save distance field cache on Windows This makes compilation possible of the saveTexture() function which is used to store the distance field glyph cache on disk when debugging. It also changes the warnings output from here to have no prefix, since this is anyway always available as the context in Qt 5. Change-Id: If3b64f0921a59c485b5321a5465369708e764afc Reviewed-by: Yoann Lopes --- src/quick/scenegraph/qsgadaptationlayer.cpp | 142 +++++++++++++--------------- 1 file changed, 67 insertions(+), 75 deletions(-) diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index 9e4b572ea6..83704cf0ec 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -294,30 +294,32 @@ void QSGDistanceFieldGlyphCache::updateTexture(GLuint oldTex, GLuint newTex, con void QSGDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int height) const { + QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions(); + GLuint fboId; - glGenFramebuffers(1, &fboId); + functions->glGenFramebuffers(1, &fboId); GLuint tmpTexture = 0; - glGenTextures(1, &tmpTexture); - glBindTexture(GL_TEXTURE_2D, tmpTexture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindTexture(GL_TEXTURE_2D, 0); - - glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId); - glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, - tmpTexture, 0); - - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, textureId); - - glDisable(GL_STENCIL_TEST); - glDisable(GL_DEPTH_TEST); - glDisable(GL_SCISSOR_TEST); - glDisable(GL_BLEND); + functions->glGenTextures(1, &tmpTexture); + functions->glBindTexture(GL_TEXTURE_2D, tmpTexture); + functions->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + functions->glBindTexture(GL_TEXTURE_2D, 0); + + functions->glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId); + functions->glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, + tmpTexture, 0); + + functions->glActiveTexture(GL_TEXTURE0); + functions->glBindTexture(GL_TEXTURE_2D, textureId); + + functions->glDisable(GL_STENCIL_TEST); + functions->glDisable(GL_DEPTH_TEST); + functions->glDisable(GL_SCISSOR_TEST); + functions->glDisable(GL_BLEND); GLfloat textureCoordinateArray[8]; textureCoordinateArray[0] = 0.0f; @@ -339,9 +341,9 @@ void QSGDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int he vertexCoordinateArray[6] = -1.0f; vertexCoordinateArray[7] = 1.0f; - glViewport(0, 0, width, height); - glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray); + functions->glViewport(0, 0, width, height); + functions->glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray); + functions->glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray); { static const char *vertexShaderSource = @@ -362,72 +364,64 @@ void QSGDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int he " gl_FragColor = texture2D(texture, textureCoords); \n" "} \n"; - GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); - GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); + GLuint vertexShader = functions->glCreateShader(GL_VERTEX_SHADER); + GLuint fragmentShader = functions->glCreateShader(GL_FRAGMENT_SHADER); if (vertexShader == 0 || fragmentShader == 0) { - GLenum error = glGetError(); - qWarning("SharedGraphicsCacheServer::setupShaderPrograms: Failed to create shaders. (GL error: %x)", + GLenum error = functions->glGetError(); + qWarning("QSGDistanceFieldGlyphCache::saveTexture: Failed to create shaders. (GL error: %x)", error); return; } - glShaderSource(vertexShader, 1, &vertexShaderSource, NULL); - glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL); - glCompileShader(vertexShader); + functions->glShaderSource(vertexShader, 1, &vertexShaderSource, NULL); + functions->glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL); + functions->glCompileShader(vertexShader); GLint len = 1; - glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &len); + functions->glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &len); char infoLog[2048]; - glGetShaderInfoLog(vertexShader, 2048, NULL, infoLog); - if (qstrlen(infoLog) > 0) { - qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling vertex shader:\n %s", - infoLog); - } + functions->glGetShaderInfoLog(vertexShader, 2048, NULL, infoLog); + if (qstrlen(infoLog) > 0) + qWarning("Problems compiling vertex shader:\n %s", infoLog); - glCompileShader(fragmentShader); - glGetShaderInfoLog(fragmentShader, 2048, NULL, infoLog); - if (qstrlen(infoLog) > 0) { - qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling fragent shader:\n %s", - infoLog); - } + functions->glCompileShader(fragmentShader); + functions->glGetShaderInfoLog(fragmentShader, 2048, NULL, infoLog); + if (qstrlen(infoLog) > 0) + qWarning("Problems compiling fragment shader:\n %s", infoLog); - GLuint shaderProgram = glCreateProgram(); - glAttachShader(shaderProgram, vertexShader); - glAttachShader(shaderProgram, fragmentShader); + GLuint shaderProgram = functions->glCreateProgram(); + functions->glAttachShader(shaderProgram, vertexShader); + functions->glAttachShader(shaderProgram, fragmentShader); - glBindAttribLocation(shaderProgram, 0, "vertexCoordsArray"); - glBindAttribLocation(shaderProgram, 1, "textureCoordArray"); + functions->glBindAttribLocation(shaderProgram, 0, "vertexCoordsArray"); + functions->glBindAttribLocation(shaderProgram, 1, "textureCoordArray"); - glLinkProgram(shaderProgram); - glGetProgramInfoLog(shaderProgram, 2048, NULL, infoLog); - if (qstrlen(infoLog) > 0) { - qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems linking shaders:\n %s", - infoLog); - } + functions->glLinkProgram(shaderProgram); + functions->glGetProgramInfoLog(shaderProgram, 2048, NULL, infoLog); + if (qstrlen(infoLog) > 0) + qWarning("Problems linking shaders:\n %s", infoLog); - glUseProgram(shaderProgram); - glEnableVertexAttribArray(0); - glEnableVertexAttribArray(1); + functions->glUseProgram(shaderProgram); + functions->glEnableVertexAttribArray(0); + functions->glEnableVertexAttribArray(1); - int textureUniformLocation = glGetUniformLocation(shaderProgram, "texture"); - glUniform1i(textureUniformLocation, 0); + int textureUniformLocation = functions->glGetUniformLocation(shaderProgram, "texture"); + functions->glUniform1i(textureUniformLocation, 0); } - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + functions->glDrawArrays(GL_TRIANGLE_FAN, 0, 4); { - GLenum error = glGetError(); - if (error != GL_NO_ERROR) { - qWarning("SharedGraphicsCacheServer::readBackBuffer: glDrawArrays reported error 0x%x", - error); - } + GLenum error = functions->glGetError(); + if (error != GL_NO_ERROR) + qWarning("glDrawArrays reported error 0x%x", error); } uchar *data = new uchar[width * height * 4]; - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); + functions->glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); QImage image(data, width, height, QImage::Format_ARGB32); @@ -437,18 +431,16 @@ void QSGDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int he image.save(QString::fromLocal8Bit(fileName)); { - GLenum error = glGetError(); - if (error != GL_NO_ERROR) { - qWarning("SharedGraphicsCacheServer::readBackBuffer: glReadPixels reported error 0x%x", - error); - } + GLenum error = functions->glGetError(); + if (error != GL_NO_ERROR) + qWarning("glReadPixels reported error 0x%x", error); } - glDisableVertexAttribArray(0); - glDisableVertexAttribArray(1); + functions->glDisableVertexAttribArray(0); + functions->glDisableVertexAttribArray(1); - glDeleteFramebuffers(1, &fboId); - glDeleteTextures(1, &tmpTexture); + functions->glDeleteFramebuffers(1, &fboId); + functions->glDeleteTextures(1, &tmpTexture); delete[] data; } -- cgit v1.2.3 From 82c36e4ff05459a5affbb6f8fab75723baee20db Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 7 Nov 2014 12:54:16 +0100 Subject: QQuickWindow autotest: verify that onClosing can block close() Task-number: QTBUG-40093 Change-Id: I800259f45d95736172d500494e68042180178e93 Reviewed-by: Caroline Chao --- tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 043203c256..a25ed9bf9c 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -341,6 +341,7 @@ private slots: void testWindowVisibilityOrder(); void blockClosing(); + void blockCloseMethod(); void crashWhenHoverItemDeleted(); @@ -1739,6 +1740,25 @@ void tst_qquickwindow::blockClosing() QTRY_VERIFY(!window->isVisible()); } +void tst_qquickwindow::blockCloseMethod() +{ + QQmlEngine engine; + QQmlComponent component(&engine); + component.loadUrl(testFileUrl("ucantclosethis.qml")); + QQuickWindow *window = qobject_cast(component.create()); + QVERIFY(window); + window->show(); + QTest::qWaitForWindowExposed(window); + QVERIFY(window->isVisible()); + QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection)); + QVERIFY(window->isVisible()); + QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection)); + QVERIFY(window->isVisible()); + window->setProperty("canCloseThis", true); + QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection)); + QTRY_VERIFY(!window->isVisible()); +} + void tst_qquickwindow::crashWhenHoverItemDeleted() { // QTBUG-32771 -- cgit v1.2.3 From cb023cbc2ab494eead21b721040a0a90db0f755c Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 7 Nov 2014 11:33:14 +0100 Subject: QQuickWindow: let 'clearFocusObject' clear all the way to the root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous code was wrong, as it cleared focus from the active focus item directly. By doing so we would only clear focus inside the focus scope that surrounded the item, but leave the scope itself with active focus (which would then be the focus object). The intended result is rather to end up with the root as focus object. Change-Id: I455a8939f8bc6c48765119b995aa781aee6d1e70 Reviewed-by: Tor Arne Vestbø --- src/quick/items/qquickwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 619e539204..262e227b16 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -893,8 +893,10 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, void QQuickWindowPrivate::clearFocusObject() { - if (activeFocusItem) - activeFocusItem->setFocus(false, Qt::OtherFocusReason); + if (activeFocusItem == contentItem) + return; + + clearFocusInScope(contentItem, QQuickItemPrivate::get(contentItem)->subFocusItem, Qt::OtherFocusReason); } void QQuickWindowPrivate::notifyFocusChangesRecur(QQuickItem **items, int remaining) -- cgit v1.2.3 From 868def84fe800aaba937159814388249ebbaf914 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Tue, 28 Oct 2014 15:40:49 +0100 Subject: qmlscene: Simplify context sharing logic. We can use the new application attribute for this now. Change-Id: Ia0a6d13d36316ec9becfb5d3251b8461ac73a2d0 Reviewed-by: Laszlo Agocs --- tools/qmlscene/main.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index bc339ae3e5..2a86b724f4 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -405,6 +405,9 @@ int main(int argc, char ** argv) } } + // QtWebEngine needs a shared context in order for the GPU thread to + // upload textures. + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, options.contextSharing); #ifdef QT_WIDGETS_LIB QApplication app(argc, argv); #else @@ -443,15 +446,6 @@ int main(int argc, char ** argv) displayFileDialog(&options); #endif - // QWebEngine needs a shared context in order for the GPU thread to - // upload textures. - QScopedPointer shareContext; - if (options.contextSharing) { - shareContext.reset(new QOpenGLContext); - shareContext->create(); - qt_gl_set_global_share_context(shareContext.data()); - } - int exitCode = 0; if (!options.file.isEmpty()) { -- cgit v1.2.3 From b5fb59fc5fa8d180daa1cb95f12238657a53bbc2 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 6 Nov 2014 13:06:26 -0800 Subject: Fix not having a context when cleaning up on Windows The same old issue surfaces in the windows render loop too. The basic render loop is already fixed, apply a similar patch to the windows one too. Task-number: QTBUG-42213 Change-Id: I07068315f5164014e329b8ce061947c97ae9da61 Reviewed-by: Friedemann Kleint Reviewed-by: Sean Harmer --- src/quick/scenegraph/qsgwindowsrenderloop.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 070d6b82fd..1213c7e771 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -210,15 +211,29 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window) hide(window); QQuickWindowPrivate *d = QQuickWindowPrivate::get(window); - if (m_gl) - m_gl->makeCurrent(window); + bool current = false; + QScopedPointer offscreenSurface; + if (m_gl) { + QSurface *surface = window; + // There may be no platform window if the window got closed. + if (!window->handle()) { + offscreenSurface.reset(new QOffscreenSurface); + offscreenSurface->setFormat(m_gl->format()); + offscreenSurface->create(); + surface = offscreenSurface.data(); + } + current = m_gl->makeCurrent(surface); + } + if (Q_UNLIKELY(!current)) + qCDebug(QSG_LOG_RENDERLOOP) << "cleanup without an OpenGL context"; + d->cleanupNodesOnShutdown(); if (m_windows.size() == 0) { d->context->invalidate(); QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); delete m_gl; m_gl = 0; - } else if (m_gl) { + } else if (m_gl && current) { m_gl->doneCurrent(); } } -- cgit v1.2.3 From 4d15f5287905a2d8e4f4aa44494d01ecc3bf0cac Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 10 Nov 2014 14:22:05 +0100 Subject: Revert "Fix pixel bleed in BorderImage" This reverts commit a9238292145e05d36be7c35bdd50829c6400a3de. It also reverts follow-up commits: 87755d0437413cfb875c50e3dfa53030601567c9 c2c710e5a8d66fa696276aa69c2e3b00436eefe5 cc8a76ce8ea76afe912902067e95ca2abf9e482f The new implementation is much too slow because it will cause each section of the border image to be uploaded to the atlas, and it will not be shared between different border images nor between different sizes of the border. The performance regression is so significant that it's not worth it for the original bug fix. We leave the tests around, so some of those might regress due to this. Change-Id: I3f56f4564255ebb77e6487881a6a11b19ad0234e Task-number: QTBUG-42288 Task-number: QTBUG-35838 Reviewed-by: Michael Brasser --- src/quick/items/qquickborderimage.cpp | 424 ++++----------------------- src/quick/items/qquickborderimage_p.h | 2 - src/quick/items/qquickborderimage_p_p.h | 10 - src/quick/items/qquickimagebase_p_p.h | 3 - src/quick/scenegraph/qsgadaptationlayer_p.h | 12 - src/quick/scenegraph/qsgdefaultimagenode.cpp | 57 +--- src/quick/scenegraph/qsgdefaultimagenode_p.h | 3 +- 7 files changed, 72 insertions(+), 439 deletions(-) diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp index 07b8958664..38bbc66896 100644 --- a/src/quick/items/qquickborderimage.cpp +++ b/src/quick/items/qquickborderimage.cpp @@ -540,390 +540,90 @@ void QQuickBorderImage::doUpdate() update(); } -QImage QQuickBorderImage::shallowCopy(const QImage &image, const QRect &rect) -{ - if (image.depth() == 1) { - return image.copy(rect); - } else { - const uchar *bits = image.constBits() + image.bytesPerLine() * rect.y() + (image.depth() / 8) * rect.x(); - return QImage(bits, rect.width(), rect.height(), image.bytesPerLine(), image.format()); - } -} - QSGNode *QQuickBorderImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { Q_D(QQuickBorderImage); - if (!d->pix.isReady() || width() <= 0 || height() <= 0) { + QSGTexture *texture = d->sceneGraphRenderContext()->textureForFactory(d->pix.textureFactory(), window()); + + if (!texture || width() <= 0 || height() <= 0) { delete oldNode; return 0; } - // Don't implicitly create the scalegrid in the rendering thread... - QRectF innerSourceRect(0, 0, 1, 1); - QRectF innerTargetRect(0, 0, width(), height()); - int borderLeft = 0, borderTop = 0, borderRight = 0, borderBottom = 0; - - bool updateNode = !oldNode; - if (d->border) { - const QQuickScaleGrid *border = d->getScaleGrid(); - - borderLeft = qBound(0, border->left(), d->pix.width()); - borderTop = qBound(0, border->top(), d->pix.height()); - borderRight = d->pix.rect().width() - qBound(0, border->right(), d->pix.rect().width() - borderLeft); - borderBottom = d->pix.rect().height() - qBound(0, border->bottom(), d->pix.rect().height() - borderTop); - - innerSourceRect = QRectF(borderLeft / qreal(d->pix.width()), - borderTop / qreal(d->pix.height()), - qMax(0, borderRight - borderLeft) / d->pix.width(), - qMax(0, borderBottom - borderTop) / d->pix.height()); - innerTargetRect = QRectF(borderLeft, - borderTop, - qMax(0, width() - border->right() - border->left()), - qMax(0, height() - border->bottom() - border->top())); - - QSizeF newSize(width(), height()); - if (innerSourceRect != d->oldInnerSourceRect - || innerTargetRect != d->oldInnerTargetRect - || newSize != d->oldSize) { - updateNode = true; - } - - d->oldInnerSourceRect = innerSourceRect; - d->oldInnerTargetRect = innerTargetRect; - d->oldSize = newSize; - } + QSGImageNode *node = static_cast(oldNode); bool updatePixmap = d->pixmapChanged; d->pixmapChanged = false; - if (updateNode) { - delete oldNode; - oldNode = new QSGNode; + if (!node) { + node = d->sceneGraphContext()->createImageNode(); updatePixmap = true; - - for (int i=0; i<9; ++i) - d->regions[i].node = 0; - - if (innerSourceRect.left() > 0) { - if (innerSourceRect.top() > 0) { - QRectF rect(0, - 0, - innerTargetRect.left(), - innerTargetRect.top()); - - if (!rect.isEmpty()) { - d->regions[0].node = d->sceneGraphContext()->createImageNode(); - d->regions[0].node->setTargetRect(rect); - d->regions[0].node->setInnerTargetRect(rect); - d->regions[0].targetRect = rect; - } - } - - if (innerSourceRect.bottom() < 1) { - QRectF rect(0, - innerTargetRect.bottom(), - innerTargetRect.left(), - height() - innerTargetRect.height() - innerTargetRect.top()); - - if (!rect.isEmpty()) { - d->regions[6].node = d->sceneGraphContext()->createImageNode(); - d->regions[6].node->setTargetRect(rect); - d->regions[6].node->setInnerTargetRect(rect); - d->regions[6].targetRect = rect; - } - } - - if (innerSourceRect.top() < innerSourceRect.bottom()) { - QRectF rect(0, - innerTargetRect.top(), - innerTargetRect.left(), - innerTargetRect.height()); - - if (!rect.isEmpty()) { - d->regions[3].node = d->sceneGraphContext()->createImageNode(); - d->regions[3].node->setTargetRect(rect); - d->regions[3].node->setInnerTargetRect(rect); - d->regions[3].targetRect = rect; - } - } - } - - if (innerSourceRect.right() < 1) { - if (innerSourceRect.top() > 0) { - QRectF rect(innerTargetRect.right(), - 0, - width() - innerTargetRect.width() - innerTargetRect.left(), - innerTargetRect.top()); - - if (!rect.isEmpty()) { - d->regions[2].node = d->sceneGraphContext()->createImageNode(); - d->regions[2].node->setTargetRect(rect); - d->regions[2].node->setInnerTargetRect(rect); - d->regions[2].targetRect = rect; - } - } - - if (innerSourceRect.bottom() < 1) { - QRectF rect(innerTargetRect.right(), - innerTargetRect.bottom(), - width() - innerTargetRect.width() - innerTargetRect.left(), - height() - innerTargetRect.height() - innerTargetRect.top()); - - if (!rect.isEmpty()) { - d->regions[8].node = d->sceneGraphContext()->createImageNode(); - d->regions[8].node->setTargetRect(rect); - d->regions[8].node->setInnerTargetRect(rect); - d->regions[8].targetRect = rect; - } - } - - if (innerSourceRect.top() < innerSourceRect.bottom()) { - QRectF rect(innerTargetRect.right(), - innerTargetRect.top(), - width() - innerTargetRect.width() - innerTargetRect.left(), - innerTargetRect.height()); - - if (!rect.isEmpty()) { - d->regions[5].node = d->sceneGraphContext()->createImageNode(); - d->regions[5].node->setTargetRect(rect); - d->regions[5].node->setInnerTargetRect(rect); - d->regions[5].targetRect = rect; - } - } - } - - if (innerSourceRect.top() > 0 && innerSourceRect.left() < innerSourceRect.right()) { - QRectF rect(innerTargetRect.left(), - 0, - innerTargetRect.width(), - innerTargetRect.top()); - - if (!rect.isEmpty()) { - d->regions[1].node = d->sceneGraphContext()->createImageNode(); - d->regions[1].node->setTargetRect(rect); - d->regions[1].node->setInnerTargetRect(rect); - d->regions[1].targetRect = rect; - } - } - - if (innerSourceRect.bottom() < 1 && innerSourceRect.left() < innerSourceRect.right()) { - QRectF rect(innerTargetRect.left(), - innerTargetRect.bottom(), - innerTargetRect.width(), - height() - innerTargetRect.height() - innerTargetRect.top()); - - if (!rect.isEmpty()) { - d->regions[7].node = d->sceneGraphContext()->createImageNode(); - d->regions[7].node->setTargetRect(rect); - d->regions[7].node->setInnerTargetRect(rect); - d->regions[7].targetRect = rect; - } - } - - if (innerSourceRect.left() < innerSourceRect.right() - && innerSourceRect.top() < innerSourceRect.bottom()) { - if (!innerTargetRect.isEmpty()) { - d->regions[4].node = d->sceneGraphContext()->createImageNode(); - d->regions[4].node->setInnerTargetRect(innerTargetRect); - d->regions[4].node->setTargetRect(innerTargetRect); - d->regions[4].targetRect = innerTargetRect; - } - } - - for (int i=0; i<9; ++i) { - if (d->regions[i].node != 0) - oldNode->appendChildNode(d->regions[i].node); - } - } - - - QImage image = d->pix.image(); - - if (d->regions[0].node != 0) { - if (updatePixmap) - d->regions[0].image = shallowCopy(image, QRect(QPoint(0, 0), QSize(borderLeft, borderTop))); - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingLeft | QSGImageNode::AntialiasingTop); - if (d->regions[1].node == 0 && d->regions[2].node == 0) - antialiasing |= QSGImageNode::AntialiasingRight; - if (d->regions[3].node == 0 && d->regions[6].node == 0) - antialiasing |= QSGImageNode::AntialiasingBottom; - d->regions[0].node->setAntialiasing(antialiasing); } - if (d->regions[1].node != 0) { - if (updatePixmap) - d->regions[1].image = shallowCopy(image, QRect(QPoint(borderLeft, 0), QSize(borderRight - borderLeft, borderTop))); - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingTop; - if (d->regions[0].node == 0) - antialiasing |= QSGImageNode::AntialiasingLeft; - if (d->regions[2].node == 0) - antialiasing |= QSGImageNode::AntialiasingRight; - if (d->regions[4].node == 0 && d->regions[7].node == 0) - antialiasing |= QSGImageNode::AntialiasingBottom; - d->regions[1].node->setAntialiasing(antialiasing); - } - - if (d->regions[2].node != 0) { - if (updatePixmap) - d->regions[2].image = shallowCopy(image, QRect(QPoint(borderRight, 0), QSize(d->pix.rect().width() - borderRight, borderTop))); + if (updatePixmap) + node->setTexture(texture); - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingTop | QSGImageNode::AntialiasingRight); - if (d->regions[0].node == 0 && d->regions[1].node == 0) - antialiasing |= QSGImageNode::AntialiasingLeft; - if (d->regions[5].node == 0 && d->regions[8].node == 0) - antialiasing |= QSGImageNode::AntialiasingBottom; - d->regions[2].node->setAntialiasing(antialiasing); - } - - if (d->regions[3].node != 0) { - if (updatePixmap) - d->regions[3].image = shallowCopy(image, QRect(QPoint(0, borderTop), QSize(borderLeft, borderBottom - borderTop))); - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingLeft; - if (d->regions[4].node == 0 && d->regions[5].node == 0) - antialiasing |= QSGImageNode::AntialiasingRight; - if (d->regions[6].node == 0) - antialiasing |= QSGImageNode::AntialiasingBottom; - if (d->regions[0].node == 0) - antialiasing |= QSGImageNode::AntialiasingTop; - d->regions[3].node->setAntialiasing(antialiasing); + // Don't implicitly create the scalegrid in the rendering thread... + QRectF innerSourceRect(0, 0, 1, 1); + QRectF targetRect(0, 0, width(), height()); + QRectF innerTargetRect = targetRect; + if (d->border) { + const QQuickScaleGrid *border = d->getScaleGrid(); + innerSourceRect = QRectF(border->left() / qreal(d->pix.width()), + border->top() / qreal(d->pix.height()), + qMax(0, d->pix.width() - border->right() - border->left()) / d->pix.width(), + qMax(0, d->pix.height() - border->bottom() - border->top()) / d->pix.height()); + innerTargetRect = QRectF(border->left(), + border->top(), + qMax(0, width() - border->right() - border->left()), + qMax(0, height() - border->bottom() - border->top())); } - - if (d->regions[4].node != 0) { - if (updatePixmap) { - if (innerSourceRect == QRectF(0, 0, 1, 1)) { - d->regions[4].image = image; - } else { - d->regions[4].image = shallowCopy(image, QRect(QPoint(borderLeft, borderTop), QSize(borderRight - borderLeft, borderBottom - borderTop))); - } + qreal hTiles = 1; + qreal vTiles = 1; + if (innerSourceRect.width() != 0) { + switch (d->horizontalTileMode) { + case QQuickBorderImage::Repeat: + hTiles = innerTargetRect.width() / qreal(innerSourceRect.width() * d->pix.width()); + break; + case QQuickBorderImage::Round: + hTiles = qCeil(innerTargetRect.width() / qreal(innerSourceRect.width() * d->pix.width())); + break; + default: + break; } - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingNone; - if (d->regions[3].node == 0) - antialiasing |= QSGImageNode::AntialiasingLeft; - if (d->regions[5].node == 0) - antialiasing |= QSGImageNode::AntialiasingRight; - if (d->regions[1].node == 0) - antialiasing |= QSGImageNode::AntialiasingTop; - if (d->regions[7].node == 0) - antialiasing |= QSGImageNode::AntialiasingBottom; - d->regions[4].node->setAntialiasing(antialiasing); } - - if (d->regions[5].node != 0) { - if (updatePixmap) - d->regions[5].image = shallowCopy(image, QRect(QPoint(borderRight, borderTop), QSize(d->pix.rect().width() - borderRight, borderBottom - borderTop))); - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingRight; - if (d->regions[4].node == 0 && d->regions[3].node == 0) - antialiasing |= QSGImageNode::AntialiasingLeft; - if (d->regions[2].node == 0) - antialiasing |= QSGImageNode::AntialiasingTop; - if (d->regions[8].node == 0) - antialiasing |= QSGImageNode::AntialiasingBottom; - d->regions[5].node->setAntialiasing(antialiasing); - } - - if (d->regions[6].node != 0) { - if (updatePixmap) - d->regions[6].image = shallowCopy(image, QRect(QPoint(0, borderBottom), QSize(borderLeft, d->pix.rect().height() - borderBottom))); - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingBottom | QSGImageNode::AntialiasingLeft); - if (d->regions[7].node == 0 && d->regions[8].node == 0) - antialiasing |= QSGImageNode::AntialiasingRight; - if (d->regions[3].node == 0 && d->regions[0].node == 0) - antialiasing |= QSGImageNode::AntialiasingTop; - d->regions[6].node->setAntialiasing(antialiasing); - } - - if (d->regions[7].node != 0) { - if (updatePixmap) - d->regions[7].image = shallowCopy(image, QRect(QPoint(borderLeft, borderBottom), QSize(borderRight - borderLeft, d->pix.rect().height() - borderBottom))); - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingBottom; - if (d->regions[6].node == 0) - antialiasing |= QSGImageNode::AntialiasingLeft; - if (d->regions[8].node == 0) - antialiasing |= QSGImageNode::AntialiasingRight; - if (d->regions[4].node == 0 && d->regions[1].node == 0) - antialiasing |= QSGImageNode::AntialiasingTop; - d->regions[7].node->setAntialiasing(antialiasing); - } - - if (d->regions[8].node != 0) { - if (updatePixmap) - d->regions[8].image = shallowCopy(image, QRect(QPoint(borderRight, borderBottom), QSize(d->pix.rect().width() - borderRight, d->pix.rect().height() - borderBottom))); - - QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingBottom | QSGImageNode::AntialiasingRight); - if (d->regions[7].node == 0 && d->regions[6].node == 0) - antialiasing |= QSGImageNode::AntialiasingLeft; - if (d->regions[5].node == 0 && d->regions[2].node == 0) - antialiasing |= QSGImageNode::AntialiasingTop; - d->regions[8].node->setAntialiasing(antialiasing); + if (innerSourceRect.height() != 0) { + switch (d->verticalTileMode) { + case QQuickBorderImage::Repeat: + vTiles = innerTargetRect.height() / qreal(innerSourceRect.height() * d->pix.height()); + break; + case QQuickBorderImage::Round: + vTiles = qCeil(innerTargetRect.height() / qreal(innerSourceRect.height() * d->pix.height())); + break; + default: + break; + } } - for (int i=0; i<9; ++i) { - if (d->regions[i].node != 0) { - if (updatePixmap) { - QQuickTextureFactory *textureFactory = QSGContext::createTextureFactoryFromImage(d->regions[i].image); - if (textureFactory == 0) - textureFactory = new QQuickDefaultTextureFactory(d->regions[i].image); - d->regions[i].textureFactory.reset(textureFactory); - d->regions[i].node->setTexture(d->sceneGraphRenderContext()->textureForFactory(d->regions[i].textureFactory.data(), - window())); - } - - d->regions[i].node->setInnerSourceRect(QRectF(0, 0, 1, 1)); - d->regions[i].node->setMipmapFiltering(QSGTexture::None); - d->regions[i].node->setFiltering(d->smooth ? QSGTexture::Linear : QSGTexture::Nearest); - d->regions[i].node->setMirror(d->mirror); - - - qreal hTiles = 1; - qreal vTiles = 1; - - if (innerSourceRect.width() != 0) { - switch (d->horizontalTileMode) { - case QQuickBorderImage::Repeat: - hTiles = d->regions[i].targetRect.width() / qreal(d->regions[i].image.width()); - break; - case QQuickBorderImage::Round: - hTiles = qCeil(d->regions[i].targetRect.width() / qreal(d->regions[i].image.width())); - break; - default: - break; - } - } - - if (innerSourceRect.height() != 0) { - switch (d->verticalTileMode) { - case QQuickBorderImage::Repeat: - vTiles = d->regions[i].targetRect.height() / qreal(d->regions[i].image.height()); - break; - case QQuickBorderImage::Round: - vTiles = qCeil(d->regions[i].targetRect.height() / qreal(d->regions[i].image.height())); - break; - default: - break; - } - } - - if (vTiles > 1 || hTiles > 1) { - d->regions[i].node->setHorizontalWrapMode(QSGTexture::Repeat); - d->regions[i].node->setVerticalWrapMode(QSGTexture::Repeat); - } else { - d->regions[i].node->setHorizontalWrapMode(QSGTexture::ClampToEdge); - d->regions[i].node->setVerticalWrapMode(QSGTexture::ClampToEdge); - } - - d->regions[i].node->setSubSourceRect(QRectF(0, 0, hTiles, vTiles)); - d->regions[i].node->update(); - } + node->setTargetRect(targetRect); + node->setInnerSourceRect(innerSourceRect); + node->setInnerTargetRect(innerTargetRect); + node->setSubSourceRect(QRectF(0, 0, hTiles, vTiles)); + node->setMirror(d->mirror); + + node->setMipmapFiltering(QSGTexture::None); + node->setFiltering(d->smooth ? QSGTexture::Linear : QSGTexture::Nearest); + if (innerSourceRect == QRectF(0, 0, 1, 1) && (vTiles > 1 || hTiles > 1)) { + node->setHorizontalWrapMode(QSGTexture::Repeat); + node->setVerticalWrapMode(QSGTexture::Repeat); + } else { + node->setHorizontalWrapMode(QSGTexture::ClampToEdge); + node->setVerticalWrapMode(QSGTexture::ClampToEdge); } + node->setAntialiasing(d->antialiasing); + node->update(); - return oldNode; + return node; } void QQuickBorderImage::pixmapChange() diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h index 1d0898115d..6a2469adc2 100644 --- a/src/quick/items/qquickborderimage_p.h +++ b/src/quick/items/qquickborderimage_p.h @@ -87,8 +87,6 @@ private Q_SLOTS: void sciRequestFinished(); private: - static QImage shallowCopy(const QImage &image, const QRect &rect); - Q_DISABLE_COPY(QQuickBorderImage) Q_DECLARE_PRIVATE(QQuickBorderImage) }; diff --git a/src/quick/items/qquickborderimage_p_p.h b/src/quick/items/qquickborderimage_p_p.h index bda2867696..d5b959fd9f 100644 --- a/src/quick/items/qquickborderimage_p_p.h +++ b/src/quick/items/qquickborderimage_p_p.h @@ -89,16 +89,6 @@ public: QQuickBorderImage::TileMode verticalTileMode; int redirectCount; - struct BorderImageRegion - { - BorderImageRegion() : node(0), textureFactory(0) {} - QImage image; - QSGImageNode *node; - QScopedPointer textureFactory; - QRectF targetRect; - }; - BorderImageRegion regions[9]; - bool pixmapChanged : 1; }; diff --git a/src/quick/items/qquickimagebase_p_p.h b/src/quick/items/qquickimagebase_p_p.h index 21d11a7448..f30eacb4ac 100644 --- a/src/quick/items/qquickimagebase_p_p.h +++ b/src/quick/items/qquickimagebase_p_p.h @@ -75,9 +75,6 @@ public: QSize sourcesize; QSize oldSourceSize; qreal devicePixelRatio; - QRectF oldInnerSourceRect; - QRectF oldInnerTargetRect; - QSizeF oldSize; bool async : 1; bool cache : 1; bool mirror: 1; diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h index 962fc5a98a..ef21385ee6 100644 --- a/src/quick/scenegraph/qsgadaptationlayer_p.h +++ b/src/quick/scenegraph/qsgadaptationlayer_p.h @@ -126,17 +126,6 @@ public: class Q_QUICK_PRIVATE_EXPORT QSGImageNode : public QSGVisitableNode { public: - enum AntialiasingFlag - { - AntialiasingNone = 0, - AntialiasingLeft = 1, - AntialiasingRight = 2, - AntialiasingTop = 4, - AntialiasingBottom = 8, - AntialiasingAll = AntialiasingLeft | AntialiasingRight | AntialiasingBottom | AntialiasingTop - }; - Q_DECLARE_FLAGS(AntialiasingFlags, AntialiasingFlag) - virtual void setTargetRect(const QRectF &rect) = 0; virtual void setInnerTargetRect(const QRectF &rect) = 0; virtual void setInnerSourceRect(const QRectF &rect) = 0; @@ -151,7 +140,6 @@ public: virtual void setFiltering(QSGTexture::Filtering filtering) = 0; virtual void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) = 0; virtual void setVerticalWrapMode(QSGTexture::WrapMode wrapMode) = 0; - virtual void setAntialiasing(AntialiasingFlags flags) { Q_UNUSED(flags); } virtual void update() = 0; diff --git a/src/quick/scenegraph/qsgdefaultimagenode.cpp b/src/quick/scenegraph/qsgdefaultimagenode.cpp index 69df506d2a..7f85c31ccb 100644 --- a/src/quick/scenegraph/qsgdefaultimagenode.cpp +++ b/src/quick/scenegraph/qsgdefaultimagenode.cpp @@ -140,11 +140,10 @@ void SmoothTextureMaterialShader::initialize() QSGDefaultImageNode::QSGDefaultImageNode() : m_innerSourceRect(0, 0, 1, 1) , m_subSourceRect(0, 0, 1, 1) + , m_antialiasing(false) , m_mirror(false) , m_dirtyGeometry(false) , m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4) - , m_antialiasing(AntialiasingNone) - { setMaterial(&m_materialO); setOpaqueMaterial(&m_material); @@ -250,20 +249,10 @@ void QSGDefaultImageNode::setTexture(QSGTexture *texture) void QSGDefaultImageNode::setAntialiasing(bool antialiasing) { - AntialiasingFlags antialiasingFlags = antialiasing - ? AntialiasingAll - : AntialiasingNone; - - setAntialiasing(antialiasingFlags); -} - -void QSGDefaultImageNode::setAntialiasing(AntialiasingFlags antialiasingFlags) -{ - if (antialiasingFlags == m_antialiasing) + if (antialiasing == m_antialiasing) return; - - m_antialiasing = antialiasingFlags; - if (m_antialiasing != AntialiasingNone) { + m_antialiasing = antialiasing; + if (m_antialiasing) { setMaterial(&m_smoothMaterial); setOpaqueMaterial(0); setGeometry(new QSGGeometry(smoothAttributeSet(), 0)); @@ -375,14 +364,11 @@ void QSGDefaultImageNode::updateGeometry() } // An image can be rendered as a single quad if: - // - There is antialiasing on all or no edges // - There are no margins, and either: // - the image isn't repeated // - the source rectangle fills the entire texture so that texture wrapping can be used, // and NPOT is supported - if (!hasMargins - && (m_antialiasing == AntialiasingAll || m_antialiasing == AntialiasingNone) - && (!hasTiles || (fullTexture && wrapSupported))) { + if (!hasMargins && (!hasTiles || (fullTexture && wrapSupported))) { QRectF sr; if (!fullTexture) { sr = QRectF(innerSourceRect.x() + (m_subSourceRect.left() - floorLeft) * innerSourceRect.width(), @@ -561,35 +547,10 @@ void QSGDefaultImageNode::updateGeometry() topDv = bottomDv *= 0.5f; } - if (!m_antialiasing.testFlag(AntialiasingTop)) { - topDy = 0.0f; - topDv = 0.0f; - } - - if (!m_antialiasing.testFlag(AntialiasingBottom)) { - bottomDy = 0.0f; - bottomDv = 0.0f; - } - - if (!m_antialiasing.testFlag(AntialiasingLeft)) { - leftDx = 0.0f; - leftDu = 0.0f; - } - - if (!m_antialiasing.testFlag(AntialiasingRight)) { - rightDx = 0.0f; - rightDu = 0.0f; - } - // This delta is how much the fuzziness can reach out from the image. float delta = float(qAbs(m_targetRect.width()) < qAbs(m_targetRect.height()) ? m_targetRect.width() : m_targetRect.height()) * 0.5f; - float deltaTop = m_antialiasing.testFlag(AntialiasingTop) ? delta : 0.0f; - float deltaBottom = m_antialiasing.testFlag(AntialiasingBottom) ? delta : 0.0f; - float deltaLeft = m_antialiasing.testFlag(AntialiasingLeft) ? delta : 0.0f; - float deltaRight = m_antialiasing.testFlag(AntialiasingRight) ? delta : 0.0f; - quint16 index = 0; ys = yData.data(); for (int j = 0; j < vCells; ++j, ys += 2) { @@ -639,28 +600,28 @@ void QSGDefaultImageNode::updateGeometry() if (isTop) { vertices[topLeft].dy = vertices[topRight].dy = topDy; vertices[topLeft].dv = vertices[topRight].dv = topDv; - vertices[topLeft + 1].dy = vertices[topRight + 1].dy = -deltaTop; + vertices[topLeft + 1].dy = vertices[topRight + 1].dy = -delta; appendQuad(&indices, topLeft + 1, topRight + 1, topLeft, topRight); } if (isBottom) { vertices[bottomLeft].dy = vertices[bottomRight].dy = -bottomDy; vertices[bottomLeft].dv = vertices[bottomRight].dv = -bottomDv; - vertices[bottomLeft + 1].dy = vertices[bottomRight + 1].dy = deltaBottom; + vertices[bottomLeft + 1].dy = vertices[bottomRight + 1].dy = delta; appendQuad(&indices, bottomLeft, bottomRight, bottomLeft + 1, bottomRight + 1); } if (isLeft) { vertices[topLeft].dx = vertices[bottomLeft].dx = leftDx; vertices[topLeft].du = vertices[bottomLeft].du = leftDu; - vertices[topLeft + 1].dx = vertices[bottomLeft + 1].dx = -deltaLeft; + vertices[topLeft + 1].dx = vertices[bottomLeft + 1].dx = -delta; appendQuad(&indices, topLeft + 1, topLeft, bottomLeft + 1, bottomLeft); } if (isRight) { vertices[topRight].dx = vertices[bottomRight].dx = -rightDx; vertices[topRight].du = vertices[bottomRight].du = -rightDu; - vertices[topRight + 1].dx = vertices[bottomRight + 1].dx = deltaRight; + vertices[topRight + 1].dx = vertices[bottomRight + 1].dx = delta; appendQuad(&indices, topRight, topRight + 1, bottomRight, bottomRight + 1); } } diff --git a/src/quick/scenegraph/qsgdefaultimagenode_p.h b/src/quick/scenegraph/qsgdefaultimagenode_p.h index 558e4d8ba4..26b087284b 100644 --- a/src/quick/scenegraph/qsgdefaultimagenode_p.h +++ b/src/quick/scenegraph/qsgdefaultimagenode_p.h @@ -62,7 +62,6 @@ public: virtual void setSubSourceRect(const QRectF &rect); virtual void setTexture(QSGTexture *t); virtual void setAntialiasing(bool antialiasing); - virtual void setAntialiasing(AntialiasingFlags antialiasing); virtual void setMirror(bool mirror); virtual void update(); @@ -85,11 +84,11 @@ private: QSGTextureMaterial m_materialO; QSGSmoothTextureMaterial m_smoothMaterial; + uint m_antialiasing : 1; uint m_mirror : 1; uint m_dirtyGeometry : 1; QSGGeometry m_geometry; - AntialiasingFlags m_antialiasing; }; QT_END_NAMESPACE -- cgit v1.2.3 From e6a419d0e3431515ae0e8ff1a344e8fdb4e94220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Fri, 24 Oct 2014 11:44:30 +0300 Subject: qml: obey QT_NO_REGULAREXPRESSION define Not all platforms do have QRegularExpression as it is based on pcre. Change-Id: I3247f8b2213f78a6e537f6781d97b0c6382482ad Reviewed-by: Simon Hausmann --- tools/qml/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 69ccd7a316..e06f249b40 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -494,6 +494,7 @@ int main(int argc, char *argv[]) foreach (const QString &path, files) { //QUrl::fromUserInput doesn't treat no scheme as relative file paths +#ifndef QT_NO_REGULAREXPRESSION QRegularExpression urlRe("[[:word:]]+://.*"); if (urlRe.match(path).hasMatch()) { //Treat as a URL QUrl url = QUrl::fromUserInput(path); @@ -503,7 +504,9 @@ int main(int argc, char *argv[]) ? QDir::toNativeSeparators(url.toLocalFile()) : url.toString())); e.load(url); - } else { //Local file path + } else +#endif + { //Local file path if (verboseMode) printf("qml: loading %s\n", qPrintable(QDir::toNativeSeparators(path))); -- cgit v1.2.3 From fac14e459734936320003c3e593481c9cb6079e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Fri, 24 Oct 2014 11:31:38 +0300 Subject: Don't embded qmldbg_tcp plugin to libQt5Qml in static build Embedding qmldbg_tcp sources to libQt5Qml causes multipled definitions of QTcpServerConnection symbols with static build on Qt Quick 2 applications. Qmake can resolve dependencies to static plugins applications use, so no need to embed this to libQt5Qml. Change-Id: I18c5e44b9ac3de4ef8be29cc5944de3527566b3c Reviewed-by: Fawzi Mohamed --- src/qml/debugger/debugger.pri | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri index 2545c7836d..77a3ba6490 100644 --- a/src/qml/debugger/debugger.pri +++ b/src/qml/debugger/debugger.pri @@ -34,8 +34,3 @@ HEADERS += \ $$PWD/qqmlprofiler_p.h INCLUDEPATH += $$PWD - -!contains(DEFINES, QT_QML_NO_DEBUGGER): static { - DEFINES += QML_DEBUGGER_EMBED - include(../../plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pri) -} -- cgit v1.2.3 From b5403efcb103423f44c707db4b07df0ff5c2203b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 6 Nov 2014 12:10:00 +0100 Subject: Add padding to distance field glyph cache Linear filtering can cause pixels outside the glyph's bounding rect to be sampled. On drivers where uninitialized texture data is actually uninitialized, this could cause artifacts in rendering for glyphs at the right edge of the initiliazed area since they would sometimes sample random pixels. To avoid this, we add padding between the glyphs in the cache. [ChangeLog][Qt Quick] Fixed uncommon artifacts in rendering of distance field glyphs. Task-number: QTBUG-42148 Change-Id: I6982b4a150d9459185d50a4362e1ead588d3860f Reviewed-by: Yoann Lopes --- .../qsgdefaultdistancefieldglyphcache.cpp | 28 +++++++++++++++------- .../qsgdefaultdistancefieldglyphcache_p.h | 3 ++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp index 093e84b618..3d958245d2 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp @@ -48,6 +48,10 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlUseGlyphCacheWorkaround, QML_USE_GLYPHCACHE_WORKAROUND) +#if !defined(QSG_DEFAULT_DISTANCEFIELD_GLYPH_CACHE_PADDING) +# define QSG_DEFAULT_DISTANCEFIELD_GLYPH_CACHE_PADDING 2 +#endif + QSGDefaultDistanceFieldGlyphCache::QSGDefaultDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, QOpenGLContext *c, const QRawFont &font) : QSGDistanceFieldGlyphCache(man, c, font) , m_maxTextureSize(0) @@ -90,8 +94,9 @@ void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet &glyph for (QSet::const_iterator it = glyphs.constBegin(); it != glyphs.constEnd() ; ++it) { glyph_t glyphIndex = *it; + int padding = QSG_DEFAULT_DISTANCEFIELD_GLYPH_CACHE_PADDING; int glyphWidth = qCeil(glyphData(glyphIndex).boundingRect.width()) + distanceFieldRadius() * 2; - QSize glyphSize(glyphWidth, QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution())); + QSize glyphSize(glyphWidth + padding * 2, QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution()) + padding * 2); QRect alloc = m_areaAllocator->allocate(glyphSize); if (alloc.isNull()) { @@ -101,7 +106,10 @@ void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet &glyph TexCoord unusedCoord = glyphTexCoord(unusedGlyph); int unusedGlyphWidth = qCeil(glyphData(unusedGlyph).boundingRect.width()) + distanceFieldRadius() * 2; - m_areaAllocator->deallocate(QRect(unusedCoord.x, unusedCoord.y, unusedGlyphWidth, QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution()))); + m_areaAllocator->deallocate(QRect(unusedCoord.x - padding, + unusedCoord.y - padding, + padding * 2 + unusedGlyphWidth, + padding * 2 + QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution()))); m_unusedGlyphs.remove(unusedGlyph); m_glyphsTexture.remove(unusedGlyph); @@ -117,11 +125,14 @@ void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet &glyph TextureInfo *tex = textureInfo(alloc.y() / maxTextureSize()); alloc = QRect(alloc.x(), alloc.y() % maxTextureSize(), alloc.width(), alloc.height()); + tex->allocatedArea |= alloc; + Q_ASSERT(tex->padding == padding || tex->padding < 0); + tex->padding = padding; GlyphPosition p; p.glyph = glyphIndex; - p.position = alloc.topLeft(); + p.position = alloc.topLeft() + QPoint(padding, padding); glyphPositions.append(p); glyphsToRender.append(glyphIndex); @@ -153,13 +164,14 @@ void QSGDefaultDistanceFieldGlyphCache::storeGlyphs(const QList glyphTextures[texInfo].append(glyphIndex); + int padding = texInfo->padding; int expectedWidth = qCeil(c.width + c.xMargin * 2); - if (glyph.width() != expectedWidth) - glyph = glyph.copy(0, 0, expectedWidth, glyph.height()); + glyph = glyph.copy(-padding, -padding, + expectedWidth + padding * 2, glyph.height() + padding * 2); if (useTextureResizeWorkaround()) { uchar *inBits = glyph.scanLine(0); - uchar *outBits = texInfo->image.scanLine(int(c.y)) + int(c.x); + uchar *outBits = texInfo->image.scanLine(int(c.y) - padding) + int(c.x) - padding; for (int y = 0; y < glyph.height(); ++y) { memcpy(outBits, inBits, glyph.width()); inBits += glyph.width(); @@ -175,13 +187,13 @@ void QSGDefaultDistanceFieldGlyphCache::storeGlyphs(const QList if (useTextureUploadWorkaround()) { for (int i = 0; i < glyph.height(); ++i) { m_funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, - c.x, c.y + i, glyph.width(),1, + c.x - padding, c.y + i - padding, glyph.width(),1, format, GL_UNSIGNED_BYTE, glyph.scanLine(i)); } } else { m_funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, - c.x, c.y, glyph.width(), glyph.height(), + c.x - padding, c.y - padding, glyph.width(), glyph.height(), format, GL_UNSIGNED_BYTE, glyph.constBits()); } diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h index f7314776d6..2f9331f6d8 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h @@ -73,8 +73,9 @@ private: QSize size; QRect allocatedArea; QDistanceField image; + int padding; - TextureInfo() : texture(0) + TextureInfo() : texture(0), padding(-1) { } }; -- cgit v1.2.3 From dd6e14a7df6e40ff8b9ffe22fe6124630a15bda0 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 5 Nov 2014 12:24:53 +0100 Subject: Doc: Change the div classes for three-column layout The new documentation style for publishing docs under qt.io requires dedicated div classes for pages that use a three- column layout. The new divs enable the columns to stack and react to changes in the window width. Task-number: QTBUG-42086 Change-Id: Id0ccb0ef7e0be237789b8c891db05413efc1f8aa Reviewed-by: Martin Smith --- src/quick/doc/src/examples.qdoc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc index 51525b8f57..0ec4507450 100644 --- a/src/quick/doc/src/examples.qdoc +++ b/src/quick/doc/src/examples.qdoc @@ -72,8 +72,8 @@ The following pages show how to develop Qt applications using \l{Qt Creator Manual}{Qt Creator} and Qt Quick. The pages demonstrate various steps such as use cases and introductory material. For more information about Qt Quick Applications and related modules, visit the \l{QML Applications} page. -\div {class="landingicons"} - \div {class="icons1of3"} +\div {class="multi-column"} + \div {class="doc-column"} \b{Development Environment} \list \li \l{Qt Creator: Creating Qt Quick Projects}{Creating Qt Quick Projects} @@ -84,7 +84,7 @@ steps such as use cases and introductory material. For more information about Qt \li \l{Qt Creator: Using QML Modules with Plugins}{Using QML Modules with Plugins} \endlist \enddiv - \div {class="icons1of3"} + \div {class="doc-column"} \b{Beginning with QML and Qt Quick} \list \li \l{First Steps with QML} @@ -92,7 +92,7 @@ steps such as use cases and introductory material. For more information about Qt \li \l{QML Advanced Tutorial}{SameGame} \endlist \enddiv - \div {class="icons1of3"} + \div {class="doc-column"} \b{Use Cases} \list \li \l{qtquick-usecase-visual.html}{Visual types in QML} @@ -120,8 +120,8 @@ Examples are small applications which show how to implement various Qt Quick features. The examples run on various platforms and are opened from within Qt Creator. -\div {class="landingicons"} - \div {class="icons1of3"} +\div {class="multi-column"} + \div {class="doc-column"} \b{QML Types and Controls} \list \li \l{Qt Quick Controls - Gallery}{Controls Gallery} @@ -132,7 +132,7 @@ Creator. \li \l{Qt Quick Examples - Toggle Switch}{Custom Toggle Switch} \endlist \enddiv - \div {class="icons1of3"} + \div {class="doc-column"} \b{Layouts and Views} \list \li \l{Qt Quick Controls - Basic Layouts Example}{Basic Layouts} @@ -142,7 +142,7 @@ Creator. \li \l{Qt Quick Examples - Right to Left}{Right-to-Left and Text Layout} \endlist \enddiv - \div {class="icons1of3"} + \div {class="doc-column"} \b{Image and Graphics} \list \li \l{Qt Quick Examples - Image Elements}{Image Elements} @@ -153,8 +153,8 @@ Creator. \enddiv \enddiv -\div {class="landingicons"} - \div {class="icons1of3"} +\div {class="multi-column"} + \div {class="doc-column"} \b{Keyboard, Focus, and Touch} \list \li \l{Qt Quick Examples - Key Interaction}{Key Interaction} @@ -162,7 +162,7 @@ Creator. \li \l{Qt Quick Controls - Touch Gallery}{Touch Gallery} \endlist \enddiv - \div {class="icons1of3"} + \div {class="doc-column"} \b{System and Events} \list \li \l{Qt Quick Examples - Threading}{Threading} @@ -171,7 +171,7 @@ Creator. \li \l{Qt Quick Examples - Drag and Drop}{Drag and Drop} \endlist \enddiv - \div {class="icons1of3"} + \div {class="doc-column"} \b{Scene Graph} \list \li \l{Scene Graph - OpenGL Under QML}{OpenGL Under QML} -- cgit v1.2.3 From 2f3c8f79d2230a8217c29b6e909bd8418ede24e8 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 12 Nov 2014 20:47:23 +0100 Subject: example, touchinteraction: use forceActiveFocus to gain focus Use forceActiveFocus to gain focus when the user clicks on a note. Just setting focus on an item is not enough to gain keyboard focus. Change-Id: Ia4a68a17df0df4b321cc6edb646b39c36167e982 Reviewed-by: J-P Nurmi Reviewed-by: Caroline Chao --- examples/quick/touchinteraction/flickable/content/Panel.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/quick/touchinteraction/flickable/content/Panel.qml b/examples/quick/touchinteraction/flickable/content/Panel.qml index a144c347e1..b2926f8098 100644 --- a/examples/quick/touchinteraction/flickable/content/Panel.qml +++ b/examples/quick/touchinteraction/flickable/content/Panel.qml @@ -116,7 +116,7 @@ Component { drag.maximumY: page.height - 80 drag.minimumX: 100 drag.maximumX: page.width - 140 - onClicked: { myText.focus = true; Qt.inputMethod.show(); } + onClicked: myText.forceActiveFocus() } } } -- cgit v1.2.3 From dd08a22a4e8d7120341a1227e227de3f0628dd2f Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 16 Oct 2014 16:57:08 +0200 Subject: Invalidate font caches when switching between threads The font caches can only be used from a single thread at a time. QFontEngineFT for instance, uses a global static thread storage which is accessed on releasing and creating engines, and this causes a crash if the font engine is created on one thread and released on another. We use the updatePolish() function to make sure the caches are empty before entering updatePaintNode(), and then we invalidate the cache again after updatePaintNode() is done. [ChangeLog][Text] Fixed uncommon crash in text nodes. Change-Id: I01dbc2ed58aeebd03d77a157c700330334bdb385 Task-number: QTBUG-38800 Reviewed-by: Konstantin Ritt --- src/quick/items/qquicktext.cpp | 45 ++++++++++++++++++++++++++++++++++--- src/quick/items/qquicktext_p.h | 1 + src/quick/items/qquicktext_p_p.h | 1 + src/quick/items/qquicktextedit.cpp | 31 +++++++++++++++++++++++++ src/quick/items/qquicktextedit_p.h | 2 ++ src/quick/items/qquicktextinput.cpp | 27 ++++++++++++++++++++++ src/quick/items/qquicktextinput_p.h | 4 ++++ 7 files changed, 108 insertions(+), 3 deletions(-) diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index bfa2fccd67..87255f4bd9 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -79,6 +79,7 @@ QQuickTextPrivate::QQuickTextPrivate() , requireImplicitSize(false), implicitWidthValid(false), implicitHeightValid(false) , truncated(false), hAlignImplicit(true), rightToLeftText(false) , layoutTextElided(false), textHasChanged(true), needToUpdateLayout(false), formatModifiesFontSize(false) + , polishSize(false) { implicitAntialiasing = true; } @@ -356,6 +357,8 @@ void QQuickTextPrivate::updateLayout() textHasChanged = true; updateLayout(); } + + q->polish(); } void QQuickText::imageDownloadFinished() @@ -2248,13 +2251,22 @@ QSGNode *QQuickText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data node->addImage(QRectF(img->pos.x() + dx, img->pos.y() + dy, pix->width(), pix->height()), pix->image()); } } + + // The font caches have now been initialized on the render thread, so they have to be + // invalidated before we can use them from the main thread again. + invalidateFontCaches(); + return node; } void QQuickText::updatePolish() { Q_D(QQuickText); - d->updateSize(); + if (d->polishSize) { + d->updateSize(); + d->polishSize = false; + } + invalidateFontCaches(); } /*! @@ -2381,6 +2393,7 @@ void QQuickText::setFontSizeMode(FontSizeMode mode) if (d->fontSizeMode() == mode) return; + d->polishSize = true; polish(); d->extra.value().fontSizeMode = mode; @@ -2409,8 +2422,10 @@ void QQuickText::setMinimumPixelSize(int size) if (d->minimumPixelSize() == size) return; - if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid())) + if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid())) { + d->polishSize = true; polish(); + } d->extra.value().minimumPixelSize = size; emit minimumPixelSizeChanged(); } @@ -2437,8 +2452,10 @@ void QQuickText::setMinimumPointSize(int size) if (d->minimumPointSize() == size) return; - if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid())) + if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid())) { + d->polishSize = true; polish(); + } d->extra.value().minimumPointSize = size; emit minimumPointSizeChanged(); } @@ -2699,4 +2716,26 @@ QString QQuickText::linkAt(qreal x, qreal y) const return d->anchorAt(QPointF(x, y)); } +/*! + * \internal + * + * Invalidates font caches owned by the text objects owned by the element + * to work around the fact that text objects cannot be used from multiple threads. + */ +void QQuickText::invalidateFontCaches() +{ + Q_D(QQuickText); + + if (d->richText && d->extra->doc != 0) { + QTextBlock block; + for (block = d->extra->doc->firstBlock(); block.isValid(); block = block.next()) { + if (block.layout() != 0 && block.layout()->engine() != 0) + block.layout()->engine()->resetFontEngineCache(); + } + } else { + if (d->layout.engine() != 0) + d->layout.engine()->resetFontEngineCache(); + } +} + QT_END_NAMESPACE diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h index c9f64d3fab..c3fa9e6935 100644 --- a/src/quick/items/qquicktext_p.h +++ b/src/quick/items/qquicktext_p.h @@ -245,6 +245,7 @@ protected: void hoverEnterEvent(QHoverEvent *event); void hoverMoveEvent(QHoverEvent *event); void hoverLeaveEvent(QHoverEvent *event); + void invalidateFontCaches(); private Q_SLOTS: void q_imagesLoaded(); diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h index 022c2ac9d5..d645ce5ed5 100644 --- a/src/quick/items/qquicktext_p_p.h +++ b/src/quick/items/qquicktext_p_p.h @@ -151,6 +151,7 @@ public: bool textHasChanged:1; bool needToUpdateLayout:1; bool formatModifiesFontSize:1; + bool polishSize:1; // Workaround for problem with polish called after updateSize (QTBUG-42636) static const QChar elideChar; diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index aca7150ca2..b950f96277 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -1739,6 +1739,7 @@ void QQuickTextEdit::triggerPreprocess() Q_D(QQuickTextEdit); if (d->updateType == QQuickTextEditPrivate::UpdateNone) d->updateType = QQuickTextEditPrivate::UpdateOnlyPreprocess; + polish(); update(); } @@ -1758,6 +1759,25 @@ static inline void updateNodeTransform(QQuickTextNode* node, const QPointF &topL node->setMatrix(transformMatrix); } +/*! + * \internal + * + * Invalidates font caches owned by the text objects owned by the element + * to work around the fact that text objects cannot be used from multiple threads. + */ +void QQuickTextEdit::invalidateFontCaches() +{ + Q_D(QQuickTextEdit); + if (d->document == 0) + return; + + QTextBlock block; + for (block = d->document->firstBlock(); block.isValid(); block = block.next()) { + if (block.layout() != 0 && block.layout()->engine() != 0) + block.layout()->engine()->resetFontEngineCache(); + } +} + QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) { Q_UNUSED(updatePaintNodeData); @@ -1911,9 +1931,16 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData * rootNode->resetCursorNode(cursor); } + invalidateFontCaches(); + return rootNode; } +void QQuickTextEdit::updatePolish() +{ + invalidateFontCaches(); +} + /*! \qmlproperty bool QtQuick::TextEdit::canPaste @@ -2079,6 +2106,7 @@ void QQuickTextEdit::q_contentsChange(int pos, int charsRemoved, int charsAdded) markDirtyNodesForRange(pos, editRange, delta); + polish(); if (isComponentComplete()) { d->updateType = QQuickTextEditPrivate::UpdatePaintNode; update(); @@ -2106,6 +2134,7 @@ void QQuickTextEdit::updateSelection() // No need for node updates when we go from an empty selection to another empty selection if (d->control->textCursor().hasSelection() || d->hadSelection) { markDirtyNodesForRange(qMin(d->lastSelectionStart, d->control->textCursor().selectionStart()), qMax(d->control->textCursor().selectionEnd(), d->lastSelectionEnd), 0); + polish(); if (isComponentComplete()) { d->updateType = QQuickTextEditPrivate::UpdatePaintNode; update(); @@ -2246,6 +2275,7 @@ void QQuickTextEdit::updateWholeDocument() node->setDirty(); } + polish(); if (isComponentComplete()) { d->updateType = QQuickTextEditPrivate::UpdatePaintNode; update(); @@ -2260,6 +2290,7 @@ void QQuickTextEdit::invalidateBlock(const QTextBlock &block) void QQuickTextEdit::updateCursor() { Q_D(QQuickTextEdit); + polish(); if (isComponentComplete()) { d->updateType = QQuickTextEditPrivate::UpdatePaintNode; update(); diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h index 54e6dd229a..5d1c026c5c 100644 --- a/src/quick/items/qquicktextedit_p.h +++ b/src/quick/items/qquicktextedit_p.h @@ -330,6 +330,7 @@ private Q_SLOTS: private: void markDirtyNodesForRange(int start, int end, int charDelta); void updateTotalLines(); + void invalidateFontCaches(); protected: virtual void geometryChanged(const QRectF &newGeometry, @@ -354,6 +355,7 @@ protected: void inputMethodEvent(QInputMethodEvent *e); #endif QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData); + void updatePolish(); friend class QQuickTextUtil; friend class QQuickTextDocument; diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 1f03fb21e2..a9c60273d2 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -56,6 +56,8 @@ #include "qquickaccessibleattached_p.h" #endif +#include + QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD) @@ -362,6 +364,7 @@ void QQuickTextInput::setColor(const QColor &c) d->color = c; d->textLayoutDirty = true; d->updateType = QQuickTextInputPrivate::UpdatePaintNode; + polish(); update(); emit colorChanged(); } @@ -389,6 +392,7 @@ void QQuickTextInput::setSelectionColor(const QColor &color) if (d->hasSelectedText()) { d->textLayoutDirty = true; d->updateType = QQuickTextInputPrivate::UpdatePaintNode; + polish(); update(); } emit selectionColorChanged(); @@ -414,6 +418,7 @@ void QQuickTextInput::setSelectedTextColor(const QColor &color) if (d->hasSelectedText()) { d->textLayoutDirty = true; d->updateType = QQuickTextInputPrivate::UpdatePaintNode; + polish(); update(); } emit selectedTextColorChanged(); @@ -723,6 +728,7 @@ void QQuickTextInput::setCursorVisible(bool on) if (!d->cursorItem) { d->setCursorBlinkPeriod(on ? qApp->styleHints()->cursorFlashTime() : 0); d->updateType = QQuickTextInputPrivate::UpdatePaintNode; + polish(); update(); } emit cursorVisibleChanged(d->cursorVisible); @@ -1830,9 +1836,23 @@ void QQuickTextInput::triggerPreprocess() Q_D(QQuickTextInput); if (d->updateType == QQuickTextInputPrivate::UpdateNone) d->updateType = QQuickTextInputPrivate::UpdateOnlyPreprocess; + polish(); update(); } +void QQuickTextInput::updatePolish() +{ + invalidateFontCaches(); +} + +void QQuickTextInput::invalidateFontCaches() +{ + Q_D(QQuickTextInput); + + if (d->m_textLayout.engine() != 0) + d->m_textLayout.engine()->resetFontEngineCache(); +} + QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) { Q_UNUSED(data); @@ -1891,6 +1911,8 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData d->textLayoutDirty = false; } + invalidateFontCaches(); + return node; } @@ -2651,6 +2673,7 @@ void QQuickTextInput::updateCursorRectangle(bool scroll) d->updateVerticalScroll(); } d->updateType = QQuickTextInputPrivate::UpdatePaintNode; + polish(); update(); emit cursorRectangleChanged(); if (d->cursorItem) { @@ -2668,6 +2691,7 @@ void QQuickTextInput::selectionChanged() Q_D(QQuickTextInput); d->textLayoutDirty = true; //TODO: Only update rect in selection d->updateType = QQuickTextInputPrivate::UpdatePaintNode; + polish(); update(); emit selectedTextChanged(); @@ -2879,6 +2903,7 @@ void QQuickTextInputPrivate::updateLayout() contentSize = QSizeF(width, height); updateType = UpdatePaintNode; + q->polish(); q->update(); if (!requireImplicitWidth && !q->widthValid()) @@ -4167,6 +4192,7 @@ void QQuickTextInputPrivate::setCursorBlinkPeriod(int msec) m_blinkTimer = 0; if (m_blinkStatus == 1) { updateType = UpdatePaintNode; + q->polish(); q->update(); } } @@ -4179,6 +4205,7 @@ void QQuickTextInput::timerEvent(QTimerEvent *event) if (event->timerId() == d->m_blinkTimer) { d->m_blinkStatus = !d->m_blinkStatus; d->updateType = QQuickTextInputPrivate::UpdatePaintNode; + polish(); update(); } else if (event->timerId() == d->m_passwordEchoTimer.timerId()) { d->m_passwordEchoTimer.stop(); diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index 4b94530587..2386fc5642 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -314,6 +314,9 @@ Q_SIGNALS: #endif void renderTypeChanged(); +private: + void invalidateFontCaches(); + protected: virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); @@ -332,6 +335,7 @@ protected: void focusInEvent(QFocusEvent *event); void timerEvent(QTimerEvent *event); QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data); + void updatePolish(); public Q_SLOTS: void selectAll(); -- cgit v1.2.3 From 05176ece31d6eb5295d96b8ba75b10cd84e603a6 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 13 Nov 2014 14:47:21 +0100 Subject: Fix render control docs Fix a typo and add a note to the signals. Change-Id: Ia8810562c5b5f192d7e54bc965807b8e78a26985 Reviewed-by: Karim Pinter Reviewed-by: Paul Olav Tvete --- src/quick/items/qquickrendercontrol.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index 7ccd3a0fb4..e433e55873 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -106,7 +106,7 @@ extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_ rendered by calling render(). After making the context current, applications are expected to call render(). - \li QQuickRenderControl::sceneChanged() Inidcates that the scene has changed + \li QQuickRenderControl::sceneChanged() Indicates that the scene has changed meaning that, before rendering, polishing and synchronizing is also necessary. \endlist @@ -296,6 +296,10 @@ void QQuickRenderControl::render() \fn void QQuickRenderControl::renderRequested() This signal is emitted when the scene graph needs to be rendered. It is not necessary to call sync(). + + \note Avoid triggering rendering directly when this signal is + emitted. Instead, prefer deferring it by using a timer for example. This + will lead to better performance. */ /*! @@ -304,6 +308,10 @@ void QQuickRenderControl::render() This signal is emitted when the scene graph is updated, meaning that polishItems() and sync() needs to be called. If sync() returns true, then render() needs to be called. + + \note Avoid triggering polishing, synchronization and rendering directly + when this signal is emitted. Instead, prefer deferring it by using a timer + for example. This will lead to better performance. */ /*! -- cgit v1.2.3 From 10b6e6a06d929358bc693a6d5d535c36dc03fe14 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 27 Oct 2014 14:58:40 +0100 Subject: Doc: removed reference to sizeHint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sizeHint is not a property of QQuickView Task-number: QTBUG-39044 Change-Id: I6e19e975ab71f73ddaf703956afb90f2e607b6f8 Reviewed-by: Martin Smith Reviewed-by: Topi Reiniö --- src/quick/items/qquickview.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index a55d056c75..b5b542a791 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -379,10 +379,6 @@ QList QQuickView::errors() const If this property is set to SizeRootObjectToView, the view will automatically resize the root item to the size of the view. - Regardless of this property, the sizeHint of the view - is the initial size of the root item. Note though that - since QML may load dynamically, that size may change. - \sa initialSize() */ -- cgit v1.2.3 From a29337be6ea54557498202ee99df1325238ea19a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 17 Nov 2014 16:11:22 +0100 Subject: Do not send deferred deletes from QQuickRenderControl::invalidate() Leave it up to the clients of QQuickRenderControl to do this, if they want it. It is usually not necessary. In the single-threaded widget world forcing deferred deletes to execute on every invalidate(), so for example from the hide event handler of QQuickWidget, is dangerous because widget apps tend to deleteLater() all sorts of widgets which can then be destroyed at unexpected times. From windowDestroyed() we continue to send the deferred deletes, just like all the render loops do. Task-number: QTBUG-42618 Task-number: QTBUG-40435 Change-Id: I8189124e2e7675361ee97bd8ba3e88b10ef193fa Reviewed-by: Gunnar Sletta --- src/quick/items/qquickrendercontrol.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index e433e55873..a666bb59c9 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -172,6 +172,10 @@ void QQuickRenderControlPrivate::windowDestroyed() /*! Initializes the scene graph resources. The context \a gl has to be the current context. + + \note Qt Quick does not take ownership of the context. It is up to the + application to destroy it after a call to invalidate() or after the + QQuickRenderControl instance is destroyed. */ void QQuickRenderControl::initialize(QOpenGLContext *gl) { @@ -274,7 +278,6 @@ void QQuickRenderControl::invalidate() // application right after returning from this function. Invalidating is // also essential to allow a subsequent initialize() to succeed. d->rc->invalidate(); - QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); d->initialized = false; } -- cgit v1.2.3 From a758382b93ba83a68da8aaf695f52bb2263bb19b Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Thu, 20 Nov 2014 14:10:03 +0200 Subject: Fix multirow spritesheet rendering in paused state Task-number: QTBUG-42777 Change-Id: I8027f100c593ae7c57df7c952e66cc2b3fae1dd9 Reviewed-by: Laszlo Agocs --- src/quick/items/qquickanimatedsprite.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickanimatedsprite.cpp b/src/quick/items/qquickanimatedsprite.cpp index f1201cf549..5ca17aecec 100644 --- a/src/quick/items/qquickanimatedsprite.cpp +++ b/src/quick/items/qquickanimatedsprite.cpp @@ -625,8 +625,25 @@ void QQuickAnimatedSprite::prepareNextFrame() qreal w = m_spriteEngine->spriteWidth() / m_sheetSize.width(); qreal h = m_spriteEngine->spriteHeight() / m_sheetSize.height(); - qreal x1 = m_spriteEngine->spriteX() / m_sheetSize.width() + frameAt * w; - qreal y1 = m_spriteEngine->spriteY() / m_sheetSize.height(); + qreal x1; + qreal y1; + if (m_paused) { + int spriteY = m_spriteEngine->spriteY(); + if (reverse) { + int rows = m_spriteEngine->maxFrames() * m_spriteEngine->spriteWidth() / m_sheetSize.width(); + spriteY -= rows * m_spriteEngine->spriteHeight(); + frameAt = (frameCount - 1) - frameAt; + } + + int position = frameAt * m_spriteEngine->spriteWidth() + m_spriteEngine->spriteX(); + int row = position / m_sheetSize.width(); + + x1 = (position - (row * m_sheetSize.width())) / m_sheetSize.width(); + y1 = (row * m_spriteEngine->spriteHeight() + spriteY) / m_sheetSize.height(); + } else { + x1 = m_spriteEngine->spriteX() / m_sheetSize.width() + frameAt * w; + y1 = m_spriteEngine->spriteY() / m_sheetSize.height(); + } //### hard-coded 0/1 work because we are the only // images in the sprite sheet (without this we cannot assume -- cgit v1.2.3 From 437f268f562fa6024c6080db6651c97572cd4acc Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 13 Nov 2014 16:30:03 +0100 Subject: Document Qt.application.supportsMultipleWindows property. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation was not added in 0df606e2ab8f3b60e1ad57dba245acf2e7810612. Change-Id: I0a5802a66021e17d1280f3969981c9e8a62c8119 Reviewed-by: Topi Reiniö Reviewed-by: Shawn Rutledge --- src/qml/qml/qqmlengine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index a187c76042..04a2f9cadd 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -491,6 +491,12 @@ The following functions are also on the Qt object. \li \c application.domain \li This is the organization domain set on the QCoreApplication instance. This property can be written to in order to set the organization domain. + + \row + \li \c application.supportsMultipleWindows + \li This read-only property can be used to determine whether or not the + platform supports multiple windows. Some embedded platforms do not support + multiple windows, for example. \endtable The object also has one signal, aboutToQuit(), which is the same as \l QCoreApplication::aboutToQuit(). -- cgit v1.2.3 From 9d7204eadd1d68823dcae790fe3f77aa2fbd4b0e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 26 Nov 2014 10:01:15 +0100 Subject: Stabilize tst_qquickflickable. - Use one engine per test - Use QQuickView for the margins test - Verify QWindow cleanup. Change-Id: Id2a10b56101832c362822963a2a7bd1d66daa143 Reviewed-by: Laszlo Agocs --- .../quick/qquickflickable/tst_qquickflickable.cpp | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index 26819ff48b..a3d902a054 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -91,12 +91,17 @@ private slots: void stopAtBounds_data(); void nestedMouseAreaUsingTouch(); void pressDelayWithLoader(); + void cleanup(); private: void flickWithTouch(QQuickWindow *window, QTouchDevice *touchDevice, const QPoint &from, const QPoint &to); - QQmlEngine engine; }; +void tst_qquickflickable::cleanup() +{ + QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); +} + void tst_qquickflickable::create() { QQmlEngine engine; @@ -199,6 +204,7 @@ void tst_qquickflickable::properties() void tst_qquickflickable::boundsBehavior() { + QQmlEngine engine; QQmlComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile("")); QQuickFlickable *flickable = qobject_cast(component.create()); @@ -330,6 +336,7 @@ void tst_qquickflickable::rebound() void tst_qquickflickable::maximumFlickVelocity() { + QQmlEngine engine; QQmlComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { maximumFlickVelocity: 1.0; }", QUrl::fromLocalFile("")); QQuickFlickable *flickable = qobject_cast(component.create()); @@ -349,6 +356,7 @@ void tst_qquickflickable::maximumFlickVelocity() void tst_qquickflickable::flickDeceleration() { + QQmlEngine engine; QQmlComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { flickDeceleration: 1.0; }", QUrl::fromLocalFile("")); QQuickFlickable *flickable = qobject_cast(component.create()); @@ -553,6 +561,7 @@ void tst_qquickflickable::nestedClickThenFlick() void tst_qquickflickable::flickableDirection() { + QQmlEngine engine; QQmlComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile("")); QQuickFlickable *flickable = qobject_cast(component.create()); @@ -1213,9 +1222,16 @@ void tst_qquickflickable::flickVelocity() void tst_qquickflickable::margins() { - QQmlEngine engine; - QQmlComponent c(&engine, testFileUrl("margins.qml")); - QQuickItem *root = qobject_cast(c.create()); + QScopedPointer window(new QQuickView); + window->setSource(testFileUrl("margins.qml")); + QTRY_COMPARE(window->status(), QQuickView::Ready); + QQuickViewTestUtil::centerOnScreen(window.data()); + QQuickViewTestUtil::moveMouseAway(window.data()); + window->setTitle(QTest::currentTestFunction()); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); + QQuickItem *root = window->rootObject(); + QVERIFY(root); QQuickFlickable *obj = qobject_cast(root); QVERIFY(obj != 0); -- cgit v1.2.3 From 93bcce48b288f3543697684346b8d35944b862c1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 25 Nov 2014 22:56:30 +0100 Subject: Add since 5.4 markers Change-Id: Ic0e594cb53016e6f68fbfb6e6064707344afefef Reviewed-by: Laszlo Agocs Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/util/qsgsimpletexturenode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp index 1e7133cf26..1fbeba83bc 100644 --- a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp +++ b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp @@ -260,6 +260,8 @@ QSGSimpleTextureNode::TextureCoordinatesTransformMode QSGSimpleTextureNode::text By default, the node does not take ownership of the texture. \sa setTexture() + + \since 5.4 */ void QSGSimpleTextureNode::setOwnsTexture(bool owns) { @@ -269,6 +271,8 @@ void QSGSimpleTextureNode::setOwnsTexture(bool owns) /*! Returns \c true if the node takes ownership of the texture; otherwise returns \c false. + + \since 5.4 */ bool QSGSimpleTextureNode::ownsTexture() const { -- cgit v1.2.3 From fa0eea53f73c9b03b259f075e4cd5b83bfefccd3 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 22 Nov 2014 21:17:34 +0100 Subject: Add missing call to rendercontrol Change-Id: Ic8c8e6d7a9d99216292b8b4faa2926d849333a05 Reviewed-by: Paul Olav Tvete --- src/quick/items/qquickwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 262e227b16..986aab3c8f 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1796,7 +1796,9 @@ void QQuickWindowPrivate::deliverTouchEvent(QTouchEvent *event) if (!delayedTouch) { delayedTouch = new QTouchEvent(event->type(), event->device(), event->modifiers(), event->touchPointStates(), event->touchPoints()); delayedTouch->setTimestamp(event->timestamp()); - if (windowManager) + if (renderControl) + QQuickRenderControlPrivate::get(renderControl)->maybeUpdate(); + else if (windowManager) windowManager->maybeUpdate(q); return; } else { -- cgit v1.2.3 From ca5e643ea9d2878f4a00546ed63a004e10da6ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 25 Nov 2014 14:22:15 +0100 Subject: Make effectiveDevicePixelRatio() return a qreal. Fractional scale factors are not as broken as previously believed, especially for Qt Quick. Keep the door open for finding a way to support it at some point in the future. Change-Id: Ifeadcc53175ac6c25ea0288d5fe1966e3de408f9 Reviewed-by: Laszlo Agocs --- src/quick/items/qquickwindow.cpp | 2 +- src/quick/items/qquickwindow.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 262e227b16..10e63430ae 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -3945,7 +3945,7 @@ void QQuickWindow::runJobsAfterSwap() * * \sa QWindow::devicePixelRatio() */ -int QQuickWindow::effectiveDevicePixelRatio() const +qreal QQuickWindow::effectiveDevicePixelRatio() const { QWindow *w = QQuickRenderControl::renderWindowFor(const_cast(this)); return w ? w->devicePixelRatio() : devicePixelRatio(); diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index 3cac691963..ddf9722313 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -142,7 +142,7 @@ public: void scheduleRenderJob(QRunnable *job, RenderStage schedule); - int effectiveDevicePixelRatio() const; + qreal effectiveDevicePixelRatio() const; Q_SIGNALS: void frameSwapped(); -- cgit v1.2.3 From c170ea57ca5a927b22726a730a7eedd274abbcfc Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Fri, 28 Nov 2014 13:43:12 +0200 Subject: Don't default to HighQualitySubPixelAntialiasing on WinRT The subpixel shader is probably not a good default here because most devices are mobile (can change screen orientation) and have high pixel densities. Furthermore, it breaks text rendering on the Surface RT, where the graphics hardware is too weak to support the number of uniforms the subpixel shader uses. Task-number: QTBUG-41769 Change-Id: I10210af91976ab55e611025c0452a1ee1f3114a9 Reviewed-by: Oliver Wolff Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/scenegraph/qsgcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 90102f1110..99695f058f 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -357,7 +357,7 @@ void QSGContext::renderContextInitialized(QSGRenderContext *renderContext) // before without a context. Now the context is ready. if (!d->distanceFieldAntialiasingDecided) { d->distanceFieldAntialiasingDecided = true; -#ifndef Q_OS_WIN +#ifndef Q_OS_WIN32 if (renderContext->openglContext()->isOpenGLES()) d->distanceFieldAntialiasing = QSGGlyphNode::GrayAntialiasing; #endif -- cgit v1.2.3 From 64c9cbf3046ca62281aac284271a13f5340f8e21 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 24 Nov 2014 15:52:42 +0100 Subject: Fix loading of .ui.qml form files with cached compilation units Simplify the type loading logic and try the Type -> Type.qml and Type -> Type.ui.qml mapping in a simple loop that tries off-disk and cached compilation unit loading. Change-Id: I537feabd0a158a71f330bede9e6988291298ae81 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlimport.cpp | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index df4006d3c2..807eb05362 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -63,7 +63,8 @@ static const QLatin1Char Backslash('\\'); static const QLatin1Char Colon(':'); static const QLatin1String Slash_qmldir("/qmldir"); static const QLatin1String String_qmldir("qmldir"); -static const QString dotqml_string(QLatin1String(".qml")); +static const QString dotqml_string(QStringLiteral(".qml")); +static const QString dotuidotqml_string(QStringLiteral(".ui.qml")); static bool designerSupportRequired = false; namespace { @@ -657,23 +658,28 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader, return (*type_return != 0); } } else if (!isLibrary) { - QString qmlUrl = url + QString::fromRawData(type.constData(), type.length()) + dotqml_string; - + QString qmlUrl; bool exists = false; - if (QQmlFile::isBundle(qmlUrl)) { - exists = QQmlFile::bundleFileExists(qmlUrl, typeLoader->engine()); - } else { - exists = !typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(qmlUrl)).isEmpty(); - if (!exists) { - QString formUrl = url + QString::fromRawData(type.constData(), type.length()) + QStringLiteral(".ui.qml"); - if (!typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(formUrl)).isEmpty()) { - exists = true; - qmlUrl = formUrl; - } + const QString urlsToTry[2] = { + url + QString::fromRawData(type.constData(), type.length()) + dotqml_string, // Type -> Type.qml + url + QString::fromRawData(type.constData(), type.length()) + dotuidotqml_string // Type -> Type.ui.qml + }; + for (uint i = 0; i < sizeof(urlsToTry) / sizeof(urlsToTry[0]); ++i) { + const QString url = urlsToTry[i]; + + if (QQmlFile::isBundle(url)) { + exists = QQmlFile::bundleFileExists(url, typeLoader->engine()); + } else { + exists = !typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(url)).isEmpty(); + if (!exists) + exists = QQmlMetaType::findCachedCompilationUnit(QUrl(url)); + } + + if (exists) { + qmlUrl = url; + break; } - if (!exists) - exists = QQmlMetaType::findCachedCompilationUnit(QUrl(qmlUrl)); } if (exists) { -- cgit v1.2.3 From 06fc202e81bfbf619ceebb9cef803270590f9e7f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 1 Dec 2014 10:45:00 +0100 Subject: Skip tst_qquickwindow::headless() when using ANGLE/Windows. The test crashes frequently. Task-number: QTBUG-42967 Change-Id: Ic17c6187bfa657154a9b04eb9c5b9a3de291cb1e Reviewed-by: Andrew Knight Reviewed-by: Laszlo Agocs --- tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index a25ed9bf9c..7c94cf6d17 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -1209,6 +1209,11 @@ void tst_qquickwindow::headless() QVERIFY(window->openglContext() == 0); } + if (QGuiApplication::platformName() == QLatin1String("windows") + && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) { + QSKIP("Crashes on Windows/ANGLE, QTBUG-42967"); + } + // Destroy the native windowing system buffers window->destroy(); QVERIFY(window->handle() == 0); -- cgit v1.2.3 From 1eedf91fcde959f5ac799f339384f44c6a9d0fd9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 1 Dec 2014 10:21:27 +0100 Subject: Regression: Fix array data corruption When inserting into a sparse JS array, we may have to re-allocate the underlying data vector. When that happens we must reload the ArrayData pointer, to avoid returning a wrong pointer in ArrayData::insert. This patch also fixes the valgrind support in the memory allocator by correctly marking the mmap'ed memory region as inaccessible. Change-Id: I86aabc2cec74a4f3c8396463910d90c8968a741d Task-number: QTBUG-42956 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4arraydata.cpp | 4 +++- src/qml/jsruntime/qv4mm.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index 35bd6e5501..0aaf50a43c 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -637,8 +637,10 @@ Property *ArrayData::insert(Object *o, uint index, bool isAccessor) o->initSparseArray(); SparseArrayData *s = static_cast(o->arrayData()); SparseArrayNode *n = s->sparse()->insert(index); - if (n->value == UINT_MAX) + if (n->value == UINT_MAX) { n->value = SparseArrayData::allocate(o, isAccessor); + s = static_cast(o->arrayData()); + } return reinterpret_cast(s->arrayData() + n->value); } diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp index b9a4a55b4a..975a5d5833 100644 --- a/src/qml/jsruntime/qv4mm.cpp +++ b/src/qml/jsruntime/qv4mm.cpp @@ -245,7 +245,7 @@ Managed *MemoryManager::allocData(std::size_t size) m_d->availableItems[pos] += uint(increase); m_d->totalItems += int(increase); #ifdef V4_USE_VALGRIND - VALGRIND_MAKE_MEM_NOACCESS(allocation.memory, allocation.chunkSize); + VALGRIND_MAKE_MEM_NOACCESS(allocation.memory.base(), allocSize); #endif } -- cgit v1.2.3 From d40fcf19f7768e6ae80532ff3d8a416132594f87 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 29 Nov 2014 09:55:50 +0100 Subject: Added change log for 5.4.0 Change-Id: Ie3e238a3ccac1d95978229316977d131be3010d6 Reviewed-by: Lars Knoll --- dist/changes-5.4.0 | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 dist/changes-5.4.0 diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 new file mode 100644 index 0000000000..748ec8f371 --- /dev/null +++ b/dist/changes-5.4.0 @@ -0,0 +1,144 @@ +Qt 5.4 introduces many new features and improvements as well as bugfixes +over the 5.3.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5 + +The Qt version 5.4 series is binary compatible with the 5.3.x series. +Applications compiled for 5.3 will continue to run with 5.4. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + +General Improvements +-------------------- + + - The Declarative State Machine Framework extends Qt's State Machine + Framework (QSM) into QML. This gives you the power of deterministic + state machines, but declaratively. + + - Added QML linter tool. + +Third party components +---------------------- + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - [QTBUG-40431] When a JavaScript object/array is passed to C++ through + a QVariant, the engine no longer immediately converts the object + recursively into a QVariantMap or QVariantList but instead stores a + QJSValue in the QVariant. This prevents a loss of data when the JS + object contains non-primitive types such as function objects for + example. Code that expects the variant type to be exactly + QVariant::Map or QVariant::List may need to be adapted. Registered + conversion functions however ensure that code that merely calls + toMap() or toList() continues to work. + - [QTBUG-39971] Qt 5.3 changed the mapping of "var" parameters in QML + declared signals to QJSValue. This was reverted to the behavior of + earlier Qt versions to use QVariant. The original issue of not being + able to pass function objects through var parameters of QML declared + signals is solved by wrapping a QJSValue inside the QVariant. + + + +**************************************************************************** +* Library * +**************************************************************************** + +QtQml +----- + + - qmldir: + [QTBUG-41489] added the ability to declare dependencies on other + modules in a module definition qmldir file + + +QtQuick +------- + + - Accessibility for Qt Quick is now included in the qtquick library + instead of being a separate plugin. + - QQuickWindow will compresses touch events and delivers at most one touch + event per frame. + - [QTBUG-38539] Added property MouseArea.drag.smoothed for toggling + whether the drag target is moved to the current mouse position after a + drag operation has started. + - [QTBUG-37944] Introduced QQuickRenderControl as a public API. + - [QTBUG-37589] Added QQuickWidget::grabFramebuffer() for capturing the + content into a QImage. + - tools and examples consistently use the QtProject organization name + - [QTBUG-40130] Add containsPress property to MouseArea + - Added QQuickFontMetrics, which provides a subset of QFontMetricsF's API. + - Added QQuickTextMetrics, which provides a declarative API for the + functions in QFontMetricsF which take arguments. + - Introduced OpenGLInfo attached type that provides information about the + currently used OpenGL version. + - Images exceeding GL_MAX_TEXTURE_SIZE will be downscaled to fit so they + will still show. + - [QTBUG-42096] Fixed nodes sometimes disappearing when adding many new + nodes to the tree. + + - Canvas: + * Implement antialiasing on FramebufferObject based render targets + through super-sampling (SSAA) when framebuffer multisampling is not + available. + + - Important Behavior Changes: + * Drag and Drop events now propagate to child items before their + parents. + * [QTBUG-40329] TextInput::displayText now includes also partial input + from an input method and thus matches with the actual displayed text. + + - Item: + * Added functions QQuickItem::grabToImage() and Item::grabToImage() to + allow grabbing of items into system-memory images. + * When Item.opacity is set to a value outside the range of 0 to 1, it + will be clamped. + + - ListView: + * Introduced headerPositioning and footerPositioning properties to + control whether header and footer are positioned inline, as overlays, + or so that they slide away and can be pulled back regardless of the + content position. + + - QQuickItem: + * Added signals sceneGraphInitialized and sceneGraphInvalidated + + - QQuickWindow: + * Added QQuickWindow::scheduleRenderJob(), a convenience alternative to + the equivalent signals for one-shot tasks. + + - SceneGraph: + * There might not be an OpenGL context bound when + QQuickWindow::sceneGraphInvalidated() is emitted if an error occurs + while cleaning up the scene graph (such as EGL_CONTEXT_LOST). This is + according to the documentation, but has never occurred in practice + before. + + - TextInput: + * Added passwordMaskDelay property + * [QTBUG-38934] Added TextInput::ensureVisible(int pos) method to be + able to control the scrolling position of a TextInput that has + automatic scrolling enabled. + + - Window: + * Added Item.Window attached property + +QtQuick.Dialogs +--------------- + + - [QTBUG-39365] FontDialog: support keyboard navigation + - [QTBUG-39231] FileDialog: added sidebarVisible property and button + + -- cgit v1.2.3 From d0b5332dcc3cbb13eab32f7dc8179df7ae2a2cc1 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 26 Nov 2014 09:59:11 +0100 Subject: Fix permissions of files Change-Id: I22958892d846da348325ba608084f8d9a05473d4 Reviewed-by: Simon Hausmann --- examples/quick/demos/samegame/content/samegame.js | 0 examples/quick/particles/images/backgroundLeaves.jpg | Bin .../tutorials/samegame/samegame4/highscores/score_data.xml | 0 .../tutorials/samegame/samegame4/highscores/score_style.xsl | 0 .../tutorials/samegame/samegame4/highscores/scores.php | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 examples/quick/demos/samegame/content/samegame.js mode change 100755 => 100644 examples/quick/particles/images/backgroundLeaves.jpg mode change 100755 => 100644 examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml mode change 100755 => 100644 examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl mode change 100755 => 100644 examples/quick/tutorials/samegame/samegame4/highscores/scores.php diff --git a/examples/quick/demos/samegame/content/samegame.js b/examples/quick/demos/samegame/content/samegame.js old mode 100755 new mode 100644 diff --git a/examples/quick/particles/images/backgroundLeaves.jpg b/examples/quick/particles/images/backgroundLeaves.jpg old mode 100755 new mode 100644 diff --git a/examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml b/examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml old mode 100755 new mode 100644 diff --git a/examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl b/examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl old mode 100755 new mode 100644 diff --git a/examples/quick/tutorials/samegame/samegame4/highscores/scores.php b/examples/quick/tutorials/samegame/samegame4/highscores/scores.php old mode 100755 new mode 100644 -- cgit v1.2.3 From b34e6717fa8b9e84390eeff4e853a18ce142434e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 7 Nov 2014 12:55:03 +0100 Subject: QtQuick.Window: add missing documentation for Window methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Several more methods/slots are inherited from QWindow but are not documented for the QML Window type. Also some other documentation improvements. Task-number: QTBUG-40093 Task-number: QTBUG-42426 Change-Id: Ib753be269cbc41ee540e6556e0ef483758eefe62 Reviewed-by: Topi Reiniö --- src/quick/items/qquickwindow.cpp | 121 +++++++++++++++++++++++++++++++++------ 1 file changed, 102 insertions(+), 19 deletions(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 9b1fad7bcc..359f68a114 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -968,10 +968,10 @@ void QQuickWindowPrivate::cleanup(QSGNode *n) Alternatively you can set or bind \l x and \l y to position the Window explicitly on the screen. - When the user attempts to close a window, the \a closing signal will be + When the user attempts to close a window, the \l closing signal will be emitted. You can force the window to stay open (for example to prompt the - user to save changes) by writing an onClosing handler and setting - close.accepted = false. + user to save changes) by writing an \c onClosing handler and setting + \c {close.accepted = false}. */ /*! \class QQuickWindow @@ -3005,7 +3005,7 @@ QOpenGLContext *QQuickWindow::openglContext() const \since 5.1 Notification that a window is about to be closed by the windowing system - (e.g. the user clicked the titlebar close button). The CloseEvent contains + (e.g. the user clicked the title bar close button). The CloseEvent contains an accepted property which can be set to false to abort closing the window. \sa Window.closing() @@ -3032,9 +3032,9 @@ QOpenGLContext *QQuickWindow::openglContext() const This signal is emitted when the user tries to close the window. - This signal includes a closeEvent parameter. The \a close \l accepted + This signal includes a \a close parameter. The \a close \l accepted property is true by default so that the window is allowed to close; but you - can implement an onClosing() handler and set close.accepted = false if + can implement an \c onClosing handler and set \c {close.accepted = false} if you need to do something else before the window can be closed. The corresponding handler is \c onClosing. @@ -3716,7 +3716,7 @@ void QQuickWindow::resetOpenGLState() Whether the window is visible on the screen. - Setting visible to false is the same as setting \l visibility to Hidden. + Setting visible to false is the same as setting \l visibility to \l {QWindow::}{Hidden}. \sa visibility */ @@ -3729,13 +3729,14 @@ void QQuickWindow::resetOpenGLState() Visibility is whether the window should appear in the windowing system as normal, minimized, maximized, fullscreen or hidden. - To set the visibility to AutomaticVisibility means to give the window a - default visible state, which might be fullscreen or windowed depending on - the platform. However when reading the visibility property you will always - get the actual state, never AutomaticVisibility. + To set the visibility to \l {QWindow::}{AutomaticVisibility} means to give the + window a default visible state, which might be \l {QWindow::}{FullScreen} or + \l {QWindow::}{Windowed} depending on the platform. However when reading the + visibility property you will always get the actual state, never + \c AutomaticVisibility. When a window is not visible its visibility is Hidden, and setting - visibility to Hidden is the same as setting \l visible to false. + visibility to \l {QWindow::}{Hidden} is the same as setting \l visible to \c false. \sa visible \since 5.1 @@ -3747,7 +3748,7 @@ void QQuickWindow::resetOpenGLState() This attached property holds whether the window is currently shown in the windowing system as normal, minimized, maximized, fullscreen or - hidden. The Window attached property can be attached to any Item. If the + hidden. The \c Window attached property can be attached to any Item. If the item is not shown in any window, the value will be \l {QWindow::}{Hidden}. \sa visible, visibility @@ -3848,12 +3849,94 @@ void QQuickWindow::resetOpenGLState() \qmlmethod QtQuick::Window::alert(int msec) \since 5.1 - Causes an alert to be shown for \a msec miliseconds. If \a msec is \c 0 (the - default), then the alert is shown indefinitely until the window becomes - active again. + Causes an alert to be shown for \a msec milliseconds. If \a msec is \c 0 + (the default), then the alert is shown indefinitely until the window + becomes active again. - In alert state, the window indicates that it demands attention, for example by - flashing or bouncing the taskbar entry. + In alert state, the window indicates that it demands attention, for example + by flashing or bouncing the taskbar entry. +*/ + +/*! + \qmlmethod QtQuick::Window::close() + + Closes the window. + + When this method is called, or when the user tries to close the window by + its title bar button, the \l closing signal will be emitted. If there is no + handler, or the handler does not revoke permission to close, the window + will subsequently close. If the QGuiApplication::quitOnLastWindowClosed + property is \c true, and there are no other windows open, the application + will quit. +*/ + +/*! + \qmlmethod QtQuick::Window::raise() + + Raises the window in the windowing system. + + Requests that the window be raised to appear above other windows. +*/ + +/*! + \qmlmethod QtQuick::Window::lower() + + Lowers the window in the windowing system. + + Requests that the window be lowered to appear below other windows. +*/ + +/*! + \qmlmethod QtQuick::Window::show() + + Shows the window. + + This is equivalent to calling showFullScreen(), showMaximized(), or showNormal(), + depending on the platform's default behavior for the window type and flags. + + \sa showFullScreen(), showMaximized(), showNormal(), hide(), flags() +*/ + +/*! + \qmlmethod QtQuick::Window::hide() + + Hides the window. + + Equivalent to setting \l visible to \c false or \l visibility to \l {QWindow::}{Hidden}. + + \sa show() +*/ + +/*! + \qmlmethod QtQuick::Window::showMinimized() + + Shows the window as minimized. + + Equivalent to setting \l visibility to \l {QWindow::}{Minimized}. +*/ + +/*! + \qmlmethod QtQuick::Window::showMaximized() + + Shows the window as maximized. + + Equivalent to setting \l visibility to \l {QWindow::}{Maximized}. +*/ + +/*! + \qmlmethod QtQuick::Window::showFullScreen() + + Shows the window as fullscreen. + + Equivalent to setting \l visibility to \l {QWindow::}{FullScreen}. +*/ + +/*! + \qmlmethod QtQuick::Window::showNormal() + + Shows the window as normal, i.e. neither maximized, minimized, nor fullscreen. + + Equivalent to setting \l visibility to \l {QWindow::}{Windowed}. */ /*! @@ -3872,7 +3955,7 @@ void QQuickWindow::resetOpenGLState() /*! \since 5.4 - Schedule \a job to run when the rendering of this window reaches + Schedules \a job to run when the rendering of this window reaches the given \a stage. This is a convenience to the equivalent signals in QQuickWindow for -- cgit v1.2.3 From b970c579163c317e1d5aa881507c029a15800746 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 27 Nov 2014 15:45:02 +0100 Subject: Remove dead code The eval code tracking was used last time for the old exception handling, but that's long gone :) Change-Id: I6fa80a5197745fde461e4da66cd65a50149c6048 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4context_p.h | 9 --------- src/qml/jsruntime/qv4globalobject.cpp | 5 ----- 2 files changed, 14 deletions(-) diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index 74530e7ae9..6d95f039c5 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -73,11 +73,6 @@ struct Q_QML_EXPORT ExecutionContext : public Managed Type_CallContext = 0x5, Type_QmlContext = 0x6 }; - struct EvalCode - { - Function *function; - EvalCode *next; - }; struct Data : Managed::Data { Data(ExecutionEngine *engine, ContextType t) @@ -89,7 +84,6 @@ struct Q_QML_EXPORT ExecutionContext : public Managed , outer(0) , lookups(0) , compilationUnit(0) - , currentEvalCode(0) , lineNumber(-1) { engine->current = reinterpret_cast(this); @@ -104,7 +98,6 @@ struct Q_QML_EXPORT ExecutionContext : public Managed ExecutionContext *outer; Lookup *lookups; CompiledData::CompilationUnit *compilationUnit; - EvalCode *currentEvalCode; int lineNumber; @@ -122,7 +115,6 @@ struct Q_QML_EXPORT ExecutionContext : public Managed d()->outer = 0; d()->lookups = 0; d()->compilationUnit = 0; - d()->currentEvalCode = 0; d()->lineNumber = -1; engine->current = this; } @@ -238,7 +230,6 @@ inline void ExecutionEngine::pushContext(CallContext *context) { context->d()->parent = current; current = context; - current->d()->currentEvalCode = 0; } inline ExecutionContext *ExecutionEngine::popContext() diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 49032e5bcf..9a9de8bb41 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -395,11 +395,6 @@ ReturnedValue EvalFunction::evalCall(CallData *callData, bool directCall) ContextStateSaver stateSaver(ctx); - ExecutionContext::EvalCode evalCode; - evalCode.function = function; - evalCode.next = ctx->d()->currentEvalCode; - ctx->d()->currentEvalCode = &evalCode; - // set the correct strict mode flag on the context ctx->d()->strictMode = strictMode(); ctx->d()->compilationUnit = function->compilationUnit; -- cgit v1.2.3 From cfdcc65cc54fc973a147044fc592779e87a669c4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 28 Nov 2014 09:24:35 +0100 Subject: Fix expression evaluation in specific frames in the debugger Expressions from the QML/JS console are intended to be executed in a specific frame / context. However that wasn't implemented properly, we should pop the current context frameNr times. [ChangeLog][QtQml] Fix inspecting objects in QML/JS console in different frames. Change-Id: If575d4005c52a9fe6805538a7b1a02b9e32049d6 Task-number: QTBUG-42831 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4debugging.cpp | 32 +++++++++++-------- tests/auto/qml/qv4debugger/tst_qv4debugger.cpp | 44 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 13 deletions(-) diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index bcf0d07719..88db9df91a 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -49,25 +49,34 @@ namespace { class JavaScriptJob: public Debugger::Job { QV4::ExecutionEngine *engine; + int frameNr; const QString &script; public: - JavaScriptJob(QV4::ExecutionEngine *engine, const QString &script) + JavaScriptJob(QV4::ExecutionEngine *engine, int frameNr, const QString &script) : engine(engine) + , frameNr(frameNr) , script(script) {} void run() { - QV4::Scope scope(engine); - QV4::ExecutionContext *ctx = engine->currentContext(); - ContextStateSaver ctxSaver(ctx); - QV4::ScopedValue result(scope); + Scope scope(engine); + + ExecutionContextSaver saver(engine->currentContext()); + + Value *savedContexts = scope.alloc(frameNr); + for (int i = 0; i < frameNr; ++i) { + savedContexts[i] = engine->currentContext(); + engine->popContext(); + } + ExecutionContext *ctx = engine->currentContext(); QV4::Script script(ctx, this->script); script.strictMode = ctx->d()->strictMode; script.inheritContext = false; script.parse(); + QV4::ScopedValue result(scope); if (!scope.engine->hasException) result = script.run(); if (scope.engine->hasException) @@ -85,7 +94,7 @@ class EvalJob: public JavaScriptJob public: EvalJob(QV4::ExecutionEngine *engine, const QString &script) - : JavaScriptJob(engine, script) + : JavaScriptJob(engine, /*frameNr*/-1, script) , result(false) {} @@ -105,8 +114,8 @@ class ExpressionEvalJob: public JavaScriptJob Debugger::Collector *collector; public: - ExpressionEvalJob(ExecutionEngine *engine, const QString &expression, Debugger::Collector *collector) - : JavaScriptJob(engine, expression) + ExpressionEvalJob(ExecutionEngine *engine, int frameNr, const QString &expression, Debugger::Collector *collector) + : JavaScriptJob(engine, frameNr, expression) , collector(collector) { } @@ -486,13 +495,10 @@ QVector Debugger::getScopeTypes(int frame) const void Debugger::evaluateExpression(int frameNr, const QString &expression, Debugger::Collector *resultsCollector) { Q_ASSERT(state() == Paused); - Q_UNUSED(frameNr); Q_ASSERT(m_runningJob == 0); - ExpressionEvalJob job(m_engine, expression, resultsCollector); - m_runningJob = &job; - m_runningJob->run(); - m_runningJob = 0; + ExpressionEvalJob job(m_engine, frameNr, expression, resultsCollector); + runInEngine(&job); } void Debugger::maybeBreakAtInstruction() diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp index 3fe14fa216..6457cb7898 100644 --- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp @@ -182,6 +182,14 @@ public: m_stackTrace = debugger->stackTrace(); + while (!m_expressionRequests.isEmpty()) { + ExpressionRequest request = m_expressionRequests.takeFirst(); + QVariantMap result; + collector.setDestination(&result); + debugger->evaluateExpression(request.frameNr, request.expression, &collector); + m_expressionResults << result[QString::fromLatin1("body")]; + } + if (m_captureContextInfo) captureContextInfo(debugger); @@ -233,6 +241,13 @@ public: QList m_capturedLocals; QVariant m_thrownValue; + struct ExpressionRequest { + QString expression; + int frameNr; + }; + QVector m_expressionRequests; + QVector m_expressionResults; + // Utility methods: void dumpStackTrace() const { @@ -269,6 +284,8 @@ private slots: // exceptions: void pauseOnThrow(); + void evaluateExpression(); + private: void evaluateJavaScript(const QString &script, const QString &fileName, int lineNumber = 1) { @@ -556,6 +573,33 @@ void tst_qv4debugger::pauseOnThrow() QCOMPARE(m_debuggerAgent->m_thrownValue.toString(), QString("hard")); } +void tst_qv4debugger::evaluateExpression() +{ + QString script = + "function testFunction() {\n" + " var x = 10\n" + " return x\n" // breakpoint + "}\n" + "var x = 20\n" + "testFunction()\n"; + + TestAgent::ExpressionRequest request; + request.expression = "x"; + request.frameNr = 0; + m_debuggerAgent->m_expressionRequests << request; + request.expression = "x"; + request.frameNr = 1; + m_debuggerAgent->m_expressionRequests << request; + + m_debuggerAgent->addBreakPoint("evaluateExpression", 3); + + evaluateJavaScript(script, "evaluateExpression"); + + QCOMPARE(m_debuggerAgent->m_expressionResults.count(), 2); + QCOMPARE(m_debuggerAgent->m_expressionResults[0].toInt(), 10); + QCOMPARE(m_debuggerAgent->m_expressionResults[1].toInt(), 20); +} + QTEST_MAIN(tst_qv4debugger) #include "tst_qv4debugger.moc" -- cgit v1.2.3 From a6fbea98ed3c2cce4bd1b2d4ec2dc055b4eaf129 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 1 Dec 2014 15:51:05 +0100 Subject: Fix conditional breakpoints in QML We need to set "inheritContext" to true for the QV4::Script that's used during conditional break point evaluation, because that will also disable fast property lookups, which is still required for QML lookups to work. Change-Id: I8976df1c827b5058eae9bdce6e86e5ea856cbfe1 Task-number: QTBUG-43018 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4debugging.cpp | 4 ++- tests/auto/qml/qv4debugger/tst_qv4debugger.cpp | 39 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index 88db9df91a..6a8d364a08 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -74,7 +74,9 @@ public: ExecutionContext *ctx = engine->currentContext(); QV4::Script script(ctx, this->script); script.strictMode = ctx->d()->strictMode; - script.inheritContext = false; + // In order for property lookups in QML to work, we need to disable fast v4 lookups. That + // is a side-effect of inheritContext. + script.inheritContext = true; script.parse(); QV4::ScopedValue result(scope); if (!scope.engine->hasException) diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp index 6457cb7898..63bfffacaa 100644 --- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp @@ -33,6 +33,8 @@ #include #include +#include +#include #include #include #include @@ -274,6 +276,7 @@ private slots: void addBreakPointWhilePaused(); void removeBreakPointForNextInstruction(); void conditionalBreakPoint(); + void conditionalBreakPointInQml(); // context access: void readArguments(); @@ -445,6 +448,42 @@ void tst_qv4debugger::conditionalBreakPoint() QCOMPARE(m_debuggerAgent->m_capturedLocals[0]["i"].toInt(), 11); } +void tst_qv4debugger::conditionalBreakPointInQml() +{ + QQmlEngine engine; + QV4::ExecutionEngine *v4 = QV8Engine::getV4(&engine); + v4->enableDebugger(); + + QScopedPointer debugThread(new QThread); + debugThread->start(); + QScopedPointer debuggerAgent(new TestAgent); + debuggerAgent->addDebugger(v4->debugger); + debuggerAgent->moveToThread(debugThread.data()); + + QQmlComponent component(&engine); + component.setData("import QtQml 2.0\n" + "QtObject {\n" + " id: root\n" + " property int foo: 42\n" + " property bool success: false\n" + " Component.onCompleted: {\n" + " success = true;\n" // breakpoint here + " }\n" + "}\n", QUrl("test.qml")); + + debuggerAgent->addBreakPoint("test.qml", 7, /*enabled*/true, "root.foo == 42"); + + QScopedPointer obj(component.create()); + QCOMPARE(obj->property("success").toBool(), true); + + QCOMPARE(debuggerAgent->m_statesWhenPaused.count(), 1); + QCOMPARE(debuggerAgent->m_statesWhenPaused.at(0).fileName, QStringLiteral("test.qml")); + QCOMPARE(debuggerAgent->m_statesWhenPaused.at(0).lineNumber, 7); + + debugThread->quit(); + debugThread->wait(); +} + void tst_qv4debugger::readArguments() { m_debuggerAgent->m_captureContextInfo = true; -- cgit v1.2.3 From 1a764d00ee56fe02a708bc057acddf03408ba303 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 1 Dec 2014 13:11:03 +0100 Subject: Fix application build when combining with Mac OS X Cocoa headers OSX's AssertMacros.h unconditionally defines macros like "check" and that clashes with qml's type discovery templates that define a check function and that are used by qmlRegisterType and friends. There's a comment in the OS X headers suggesting that this will be fixed in the "next" release, but that hasn't happened for a while and the bug is still present in 10.10. So let's work around it and make life easier for people using Qml and Cocoa at the same time. Change-Id: I005d21188f92deaebd45bce2e6484cd4deeb9a34 Task-number: QTBUG-36309 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlprivate.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index 29d2bc6193..dfbf04a50f 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -122,12 +122,12 @@ namespace QQmlPrivate typedef int yes_type; typedef char no_type; - static yes_type check(To *); - static no_type check(...); + static yes_type checkType(To *); + static no_type checkType(...); static inline int cast() { - return StaticCastSelectorClass(0)))>::cast(); + return StaticCastSelectorClass(0)))>::cast(); } }; @@ -145,10 +145,10 @@ namespace QQmlPrivate typedef char no_type; template - static yes_type check(ReturnType *(*)(QObject *)); - static no_type check(...); + static yes_type checkType(ReturnType *(*)(QObject *)); + static no_type checkType(...); - static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type); + static bool const value = sizeof(checkType(&T::qmlAttachedProperties)) == sizeof(yes_type); }; template -- cgit v1.2.3 From 2509e9b7bcb9f06351016433244e529436f380cc Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 3 Dec 2014 10:37:16 +0100 Subject: Fix crashes on QNX/x86 On x86 we assume that ebx holds the address of the global offset table for position independent code. So before placing a run-time call we restore the register from it's position we saved it on earlier on the stack. However after commit d9f33ccdef985badc56fd8940373748626beffc7 the register wasn't saved on the stack anymore in the prologue because we skipped because it's caller saved. So when we seemingly reloaded ebx with the GOT from the stack, we loaded it from a location we never saved it to. This patch makes sure to always save it on the stack so that we can always restore it. Change-Id: I8f6a8e38779151fff517f17220f29a7cb45ca89d Task-number: QTBUG-43036 Reviewed-by: Erik Verbruggen --- src/qml/jit/qv4isel_masm.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp index 9ff33feff2..f4a1ec5f69 100644 --- a/src/qml/jit/qv4isel_masm.cpp +++ b/src/qml/jit/qv4isel_masm.cpp @@ -1530,16 +1530,15 @@ void InstructionSelection::calculateRegistersToSave(const RegisterInformation &u fpRegistersToSave.clear(); foreach (const RegisterInfo &ri, Assembler::getRegisterInfo()) { +#if defined(RESTORE_EBX_ON_CALL) + if (ri.isRegularRegister() && ri.reg() == JSC::X86Registers::ebx) { + regularRegistersToSave.append(ri); + continue; + } +#endif // RESTORE_EBX_ON_CALL if (ri.isCallerSaved()) continue; - if (ri.isRegularRegister()) { -#if defined(RESTORE_EBX_ON_CALL) - if (ri.isRegularRegister() && ri.reg() == JSC::X86Registers::ebx) { - regularRegistersToSave.append(ri); - continue; - } -#endif // RESTORE_EBX_ON_CALL if (ri.isPredefined() || used.contains(ri)) regularRegistersToSave.append(ri); } else { -- cgit v1.2.3 From 43c93a55e28a4655d8bc8d49a81b7802d7157244 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 3 Dec 2014 14:42:12 +0100 Subject: Error out when trying to set an item as its own parent Task-number: QTBUG-43063 Change-Id: I92a33047ac7fa2afeff4986b6e42c07afbc59918 Reviewed-by: J-P Nurmi --- src/quick/items/qquickitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 825dd8ddfa..2722f48ce9 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2481,7 +2481,7 @@ void QQuickItem::setParentItem(QQuickItem *parentItem) return; if (parentItem) { - QQuickItem *itemAncestor = parentItem->parentItem(); + QQuickItem *itemAncestor = parentItem; while (itemAncestor != 0) { if (itemAncestor == this) { qWarning("QQuickItem::setParentItem: Parent is already part of this items subtree."); -- cgit v1.2.3 From b60bedf42ce7714180ced5597e8849b66a4d942b Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Mon, 1 Dec 2014 14:32:57 +1000 Subject: Fix QtQuick2 module unload support This commit ensures that the value type providers installed by the QtQuick2 QML module during initialization are uninstalled when the plugin is unloaded. It also fixes a bug in the type compiler so that it now works with types from plugins which get unloaded and then reloaded. Task-number: QTBUG-43004 Change-Id: I4b3fb75aae65dfbc5de9c88701ed82514087ab7d Reviewed-by: Matthew Vogt --- src/imports/qtquick2/plugin.cpp | 5 ++ src/qml/compiler/qqmltypecompiler.cpp | 2 +- src/quick/qtquick2.cpp | 5 ++ src/quick/qtquick2_p.h | 1 + src/quick/qtquickglobal_p.h | 1 + src/quick/util/qquickglobal.cpp | 7 +++ .../auto/qml/qqmlenginecleanup/data/testFile1.qml | 49 ++++++++++++++++ .../auto/qml/qqmlenginecleanup/data/testFile2.qml | 46 +++++++++++++++ .../auto/qml/qqmlenginecleanup/data/testFile3.qml | 68 ++++++++++++++++++++++ .../qqmlenginecleanup/tst_qqmlenginecleanup.cpp | 45 ++++++++++++++ 10 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 tests/auto/qml/qqmlenginecleanup/data/testFile1.qml create mode 100644 tests/auto/qml/qqmlenginecleanup/data/testFile2.qml create mode 100644 tests/auto/qml/qqmlenginecleanup/data/testFile3.qml diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index d5096fc6e8..ad3db2290f 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -49,6 +49,11 @@ public: Q_UNUSED(uri); QQmlQtQuick2Module::defineModule(); } + + ~QtQuick2Plugin() + { + QQmlQtQuick2Module::undefineModule(); + } }; //![class decl] diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index 3a27a859fd..8edf4bbe7c 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -1389,7 +1389,7 @@ void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents(const QmlI if (!mo) continue; - static QQmlType *componentType = QQmlMetaType::qmlType(&QQmlComponent::staticMetaObject); + QQmlType *componentType = QQmlMetaType::qmlType(&QQmlComponent::staticMetaObject); Q_ASSERT(componentType); QmlIR::Object *syntheticComponent = pool->New(); diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp index 6acff85961..09784d161a 100644 --- a/src/quick/qtquick2.cpp +++ b/src/quick/qtquick2.cpp @@ -194,5 +194,10 @@ void QQmlQtQuick2Module::defineModule() } } +void QQmlQtQuick2Module::undefineModule() +{ + QQuick_deinitializeProviders(); +} + QT_END_NAMESPACE diff --git a/src/quick/qtquick2_p.h b/src/quick/qtquick2_p.h index 2847d5d3ff..8f415cbd02 100644 --- a/src/quick/qtquick2_p.h +++ b/src/quick/qtquick2_p.h @@ -42,6 +42,7 @@ class Q_QUICK_PRIVATE_EXPORT QQmlQtQuick2Module { public: static void defineModule(); + static void undefineModule(); }; QT_END_NAMESPACE diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h index e2bf198b1c..7fe09da92e 100644 --- a/src/quick/qtquickglobal_p.h +++ b/src/quick/qtquickglobal_p.h @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE void QQuick_initializeProviders(); +void QQuick_deinitializeProviders(); Q_DECLARE_LOGGING_CATEGORY(DBG_TOUCH) Q_DECLARE_LOGGING_CATEGORY(DBG_MOUSE) diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 455e180dbe..139bae4038 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -982,4 +982,11 @@ void QQuick_initializeProviders() QQml_setGuiProvider(getGuiProvider()); } +void QQuick_deinitializeProviders() +{ + QQml_removeValueTypeProvider(getValueTypeProvider()); + QQml_setColorProvider(0); // technically, another plugin may have overridden our providers + QQml_setGuiProvider(0); // but we cannot handle that case in a sane way. +} + QT_END_NAMESPACE diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml new file mode 100644 index 0000000000..3bd8e22ce4 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite 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$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + Item { + id: c1 + } + property Item a: c1 +} diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml new file mode 100644 index 0000000000..9a32114918 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite 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$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property variant a: Qt.rgba(0.3, 0.4, 0.5, 0.6) +} diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml new file mode 100644 index 0000000000..c55c355388 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite 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$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + ListView { + anchors.fill: parent + model: simpleModel + delegate: Text { + text: name + } + } + + ListModel { + id: simpleModel + ListElement { + name: "first" + } + ListElement { + name: "second" + } + ListElement { + name: "third" + } + } +} diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp index fcc3e6a0a9..c8fae624a7 100644 --- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp +++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp @@ -46,6 +46,7 @@ public: private slots: void test_qmlClearTypeRegistrations(); + void test_valueTypeProviderModule(); // QTBUG-43004 }; void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations() @@ -85,6 +86,50 @@ void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations() delete component; } +static void cleanState(QQmlEngine **e) +{ + delete *e; + qmlClearTypeRegistrations(); + *e = new QQmlEngine; + QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); + QCoreApplication::processEvents(); +} + +void tst_qqmlenginecleanup::test_valueTypeProviderModule() +{ + // this test ensures that a module which installs a value type + // provider can be reinitialized after multiple calls to + // qmlClearTypeRegistrations() without causing cycles in the + // value type provider list. + QQmlEngine *e = 0; + QUrl testFile1 = testFileUrl("testFile1.qml"); + QUrl testFile2 = testFileUrl("testFile2.qml"); + bool noCycles = false; + for (int i = 0; i < 20; ++i) { + cleanState(&e); + QQmlComponent c(e, this); + c.loadUrl(i % 2 == 0 ? testFile1 : testFile2); // this will hang if cycles exist. + } + delete e; + e = 0; + noCycles = true; + QVERIFY(noCycles); + + // this test ensures that no crashes occur due to using + // a dangling QQmlType pointer in the type compiler + // which results from qmlClearTypeRegistrations() + QUrl testFile3 = testFileUrl("testFile3.qml"); + bool noDangling = false; + for (int i = 0; i < 20; ++i) { + cleanState(&e); + QQmlComponent c(e, this); + c.loadUrl(i % 2 == 0 ? testFile1 : testFile3); // this will crash if dangling ptr exists. + } + delete e; + noDangling = true; + QVERIFY(noDangling); +} + QTEST_MAIN(tst_qqmlenginecleanup) #include "tst_qqmlenginecleanup.moc" -- cgit v1.2.3 From 00894e5af4867fdc48d723da1c7f8e5ff4d8556d Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 18 Nov 2014 10:16:52 +0100 Subject: Correct QtQml.Models \qmlmodule version. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example, the following documentation [1] says: Import Statement: import QtQml.Models 2.0 This should be: Import Statement: import QtQml.Models 2.1 The module documentation [2] is correct, but there's no visible link to that page from [1]. [1] http://qt-project.org/doc/qt-5/qml-qtqml-models-objectmodel.html [2] http://qt-project.org/doc/qt-5/qtqml-models-qmlmodule.html Change-Id: Ib2ab7b821ad7e98c20b396b26f745ee39434b7fb Reviewed-by: Topi Reiniö --- src/imports/models/plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp index c0877be967..82c64764d8 100644 --- a/src/imports/models/plugin.cpp +++ b/src/imports/models/plugin.cpp @@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE /*! - \qmlmodule QtQml.Models 2 + \qmlmodule QtQml.Models 2.1 \title Qt QML Models QML Types \ingroup qmlmodules \brief Provides QML types for data models -- cgit v1.2.3 From 2ab6b863f4493acf5256de0027f1e3daa0fdd038 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 4 Dec 2014 14:19:09 +0100 Subject: Add string::arg method in installTranslatorFunctions QJSEngine::installTranslatorFunctions install the translator functions to any given JS object. However, the custom string::arg() method is only added in qqmlbuiltinfunctions.cpp, making the use of qsTr() in other pure-JS programs quite hard. Task-number: QTBUG-43113 Change-Id: Ia9ed97a4c07a4d167c792f3ea13e4f6e96c97423 Reviewed-by: Simon Hausmann --- src/qml/jsapi/qjsengine.cpp | 6 ++++++ tests/auto/qml/qjsengine/tst_qjsengine.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index 0d2b394cd6..d7f45b56e0 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -243,6 +243,8 @@ void QJSEngine::collectGarbage() \row \li QT_TRID_NOOP() \li QT_TRID_NOOP() \endtable + It also adds an arg() method to the string prototype. + \sa {Internationalization with Qt} */ void QJSEngine::installTranslatorFunctions(const QJSValue &object) @@ -260,6 +262,10 @@ void QJSEngine::installTranslatorFunctions(const QJSValue &object) obj->defineDefaultProperty(QStringLiteral("QT_TR_NOOP"), QV4::GlobalExtensions::method_qsTrNoOp); obj->defineDefaultProperty(QStringLiteral("qsTrId"), QV4::GlobalExtensions::method_qsTrId); obj->defineDefaultProperty(QStringLiteral("QT_TRID_NOOP"), QV4::GlobalExtensions::method_qsTrIdNoOp); + + // string prototype extension + v4->stringObjectClass->prototype->defineDefaultProperty(QStringLiteral("arg"), + QV4::GlobalExtensions::method_string_arg); #endif } diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 741fa9f04d..c43bd29614 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -3190,6 +3190,11 @@ void tst_QJSEngine::installTranslatorFunctions() QVERIFY(ret.isString()); QCOMPARE(ret.toString(), QString::fromLatin1("foo")); } + { + QJSValue ret = eng.evaluate("qsTr('%1').arg('foo')"); + QVERIFY(ret.isString()); + QCOMPARE(ret.toString(), QString::fromLatin1("foo")); + } QVERIFY(eng.evaluate("QT_TRID_NOOP()").isUndefined()); } -- cgit v1.2.3 From e8338b8e861c8b94592c8e076c2b375814c0d791 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 4 Dec 2014 09:50:44 +0100 Subject: Update plugins.qmltypes Change-Id: I9b6c54b572d4653d609b154000e274b9e64d591f Reviewed-by: Fawzi Mohamed Reviewed-by: Simon Hausmann --- src/imports/localstorage/plugins.qmltypes | 2 + src/imports/particles/plugins.qmltypes | 4 + src/imports/qtquick2/plugins.qmltypes | 263 ++++++++++++++++++++++++++++-- src/imports/testlib/plugins.qmltypes | 6 + src/imports/window/plugins.qmltypes | 15 +- src/quick/items/qquicktextedit_p.h | 2 +- src/quick/items/qquicktextinput_p.h | 2 +- 7 files changed, 278 insertions(+), 16 deletions(-) diff --git a/src/imports/localstorage/plugins.qmltypes b/src/imports/localstorage/plugins.qmltypes index 05bcc875f7..ff4c897f58 100644 --- a/src/imports/localstorage/plugins.qmltypes +++ b/src/imports/localstorage/plugins.qmltypes @@ -11,6 +11,8 @@ Module { name: "QQuickLocalStorage" prototype: "QObject" exports: ["QtQuick.LocalStorage/LocalStorage 2.0"] + isCreatable: false + isSingleton: true exportMetaObjectRevisions: [0] Method { name: "openDatabaseSync" diff --git a/src/imports/particles/plugins.qmltypes b/src/imports/particles/plugins.qmltypes index 712d4fd844..b1b825dea6 100644 --- a/src/imports/particles/plugins.qmltypes +++ b/src/imports/particles/plugins.qmltypes @@ -213,6 +213,7 @@ Module { name: "QQuickDirection" prototype: "QObject" exports: ["QtQuick.Particles/NullVector 2.0"] + isCreatable: false exportMetaObjectRevisions: [0] } Component { @@ -574,6 +575,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick.Particles/ParticleAffector 2.0"] + isCreatable: false exportMetaObjectRevisions: [0] Property { name: "system"; type: "QQuickParticleSystem"; isPointer: true } Property { name: "groups"; type: "QStringList" } @@ -800,6 +802,7 @@ Module { name: "QQuickParticleExtruder" prototype: "QObject" exports: ["QtQuick.Particles/ParticleExtruder 2.0"] + isCreatable: false exportMetaObjectRevisions: [0] } Component { @@ -836,6 +839,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick.Particles/ParticlePainter 2.0"] + isCreatable: false exportMetaObjectRevisions: [0] Property { name: "system"; type: "QQuickParticleSystem"; isPointer: true } Property { name: "groups"; type: "QStringList" } diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes index dd41871e45..d98e9e6981 100644 --- a/src/imports/qtquick2/plugins.qmltypes +++ b/src/imports/qtquick2/plugins.qmltypes @@ -800,6 +800,7 @@ Module { Property { name: "role"; type: "QAccessible::Role" } Property { name: "name"; type: "string" } Property { name: "description"; type: "string" } + Property { name: "ignored"; type: "bool" } Property { name: "checkable"; type: "bool" } Property { name: "checked"; type: "bool" } Property { name: "editable"; type: "bool" } @@ -814,6 +815,7 @@ Module { Property { name: "defaultButton"; type: "bool" } Property { name: "passwordEdit"; type: "bool" } Property { name: "selectableText"; type: "bool" } + Property { name: "searchEdit"; type: "bool" } Signal { name: "checkableChanged" Parameter { name: "arg"; type: "bool" } @@ -870,8 +872,20 @@ Module { name: "selectableTextChanged" Parameter { name: "arg"; type: "bool" } } + Signal { + name: "searchEditChanged" + Parameter { name: "arg"; type: "bool" } + } + Signal { name: "pressAction" } + Signal { name: "toggleAction" } + Signal { name: "increaseAction" } + Signal { name: "decreaseAction" } Method { name: "valueChanged" } Method { name: "cursorPositionChanged" } + Method { + name: "setIgnored" + Parameter { name: "ignored"; type: "bool" } + } } Component { name: "QQuickAnchorAnimation" @@ -1367,6 +1381,7 @@ Module { Property { name: "maximumY"; type: "double" } Property { name: "active"; type: "bool"; isReadonly: true } Property { name: "filterChildren"; type: "bool" } + Property { name: "smoothed"; type: "bool" } Property { name: "threshold"; type: "double" } } Component { @@ -1631,6 +1646,61 @@ Module { Property { name: "name"; type: "string" } Property { name: "status"; type: "Status"; isReadonly: true } } + Component { + name: "QQuickFontMetrics" + prototype: "QObject" + exports: ["QtQuick/FontMetrics 2.4"] + exportMetaObjectRevisions: [0] + Property { name: "font"; type: "QFont" } + Property { name: "ascent"; type: "double"; isReadonly: true } + Property { name: "descent"; type: "double"; isReadonly: true } + Property { name: "height"; type: "double"; isReadonly: true } + Property { name: "leading"; type: "double"; isReadonly: true } + Property { name: "lineSpacing"; type: "double"; isReadonly: true } + Property { name: "minimumLeftBearing"; type: "double"; isReadonly: true } + Property { name: "minimumRightBearing"; type: "double"; isReadonly: true } + Property { name: "maximumCharacterWidth"; type: "double"; isReadonly: true } + Property { name: "xHeight"; type: "double"; isReadonly: true } + Property { name: "averageCharacterWidth"; type: "double"; isReadonly: true } + Property { name: "underlinePosition"; type: "double"; isReadonly: true } + Property { name: "overlinePosition"; type: "double"; isReadonly: true } + Property { name: "strikeOutPosition"; type: "double"; isReadonly: true } + Property { name: "lineWidth"; type: "double"; isReadonly: true } + Signal { + name: "fontChanged" + Parameter { name: "font"; type: "QFont" } + } + Method { + name: "advanceWidth" + type: "double" + Parameter { name: "text"; type: "string" } + } + Method { + name: "boundingRect" + type: "QRectF" + Parameter { name: "text"; type: "string" } + } + Method { + name: "tightBoundingRect" + type: "QRectF" + Parameter { name: "text"; type: "string" } + } + Method { + name: "elidedText" + type: "string" + Parameter { name: "text"; type: "string" } + Parameter { name: "mode"; type: "Qt::TextElideMode" } + Parameter { name: "width"; type: "double" } + Parameter { name: "flags"; type: "int" } + } + Method { + name: "elidedText" + type: "string" + Parameter { name: "text"; type: "string" } + Parameter { name: "mode"; type: "Qt::TextElideMode" } + Parameter { name: "width"; type: "double" } + } + } Component { name: "QQuickFontValueType" prototype: "QQmlValueType" @@ -1903,8 +1973,8 @@ Module { name: "QQuickItem" defaultProperty: "data" prototype: "QObject" - exports: ["QtQuick/Item 2.0", "QtQuick/Item 2.1"] - exportMetaObjectRevisions: [0, 1] + exports: ["QtQuick/Item 2.0", "QtQuick/Item 2.1", "QtQuick/Item 2.4"] + exportMetaObjectRevisions: [0, 1, 2] Enum { name: "TransformOrigin" values: { @@ -2010,6 +2080,19 @@ Module { Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } } Method { name: "update" } + Method { + name: "grabToImage" + revision: 2 + type: "bool" + Parameter { name: "callback"; type: "QJSValue" } + Parameter { name: "targetSize"; type: "QSize" } + } + Method { + name: "grabToImage" + revision: 2 + type: "bool" + Parameter { name: "callback"; type: "QJSValue" } + } Method { name: "contains" type: "bool" @@ -2042,6 +2125,18 @@ Module { Parameter { name: "y"; type: "double" } } } + Component { + name: "QQuickItemGrabResult" + prototype: "QObject" + Property { name: "image"; type: "QImage"; isReadonly: true } + Property { name: "url"; type: "QUrl"; isReadonly: true } + Signal { name: "ready" } + Method { + name: "saveToFile" + type: "bool" + Parameter { name: "fileName"; type: "string" } + } + } Component { name: "QQuickItemLayer" prototype: "QObject" @@ -2435,8 +2530,12 @@ Module { name: "QQuickListView" defaultProperty: "data" prototype: "QQuickItemView" - exports: ["QtQuick/ListView 2.0", "QtQuick/ListView 2.1"] - exportMetaObjectRevisions: [0, 1] + exports: [ + "QtQuick/ListView 2.0", + "QtQuick/ListView 2.1", + "QtQuick/ListView 2.4" + ] + exportMetaObjectRevisions: [0, 1, 2] attachedType: "QQuickListViewAttached" Enum { name: "Orientation" @@ -2453,6 +2552,22 @@ Module { "SnapOneItem": 2 } } + Enum { + name: "HeaderPositioning" + values: { + "InlineHeader": 0, + "OverlayHeader": 1, + "PullBackHeader": 2 + } + } + Enum { + name: "FooterPositioning" + values: { + "InlineFooter": 0, + "OverlayFooter": 1, + "PullBackFooter": 2 + } + } Property { name: "highlightMoveVelocity"; type: "double" } Property { name: "highlightResizeVelocity"; type: "double" } Property { name: "highlightResizeDuration"; type: "int" } @@ -2461,6 +2576,10 @@ Module { Property { name: "section"; type: "QQuickViewSection"; isReadonly: true; isPointer: true } Property { name: "currentSection"; type: "string"; isReadonly: true } Property { name: "snapMode"; type: "SnapMode" } + Property { name: "headerPositioning"; revision: 2; type: "HeaderPositioning" } + Property { name: "footerPositioning"; revision: 2; type: "FooterPositioning" } + Signal { name: "headerPositioningChanged"; revision: 2 } + Signal { name: "footerPositioningChanged"; revision: 2 } Method { name: "incrementCurrentIndex" } Method { name: "decrementCurrentIndex" } } @@ -2504,8 +2623,8 @@ Module { name: "QQuickMouseArea" defaultProperty: "data" prototype: "QQuickItem" - exports: ["QtQuick/MouseArea 2.0"] - exportMetaObjectRevisions: [0] + exports: ["QtQuick/MouseArea 2.0", "QtQuick/MouseArea 2.4"] + exportMetaObjectRevisions: [0, 1] Property { name: "mouseX"; type: "double"; isReadonly: true } Property { name: "mouseY"; type: "double"; isReadonly: true } Property { name: "containsMouse"; type: "bool"; isReadonly: true } @@ -2518,6 +2637,7 @@ Module { Property { name: "preventStealing"; type: "bool" } Property { name: "propagateComposedEvents"; type: "bool" } Property { name: "cursorShape"; type: "Qt::CursorShape" } + Property { name: "containsPress"; revision: 1; type: "bool"; isReadonly: true } Signal { name: "hoveredChanged" } Signal { name: "positionChanged" @@ -2558,6 +2678,7 @@ Module { Signal { name: "entered" } Signal { name: "exited" } Signal { name: "canceled" } + Signal { name: "containsPressChanged"; revision: 1 } } Component { name: "QQuickMouseEvent" @@ -2620,6 +2741,33 @@ Module { exports: ["QtQuick/OpacityAnimator 2.2"] exportMetaObjectRevisions: [0] } + Component { + name: "QQuickOpenGLInfo" + prototype: "QObject" + exports: ["QtQuick/OpenGLInfo 2.4"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "ContextProfile" + values: { + "NoProfile": 0, + "CoreProfile": 1, + "CompatibilityProfile": 2 + } + } + Enum { + name: "RenderableType" + values: { + "Unspecified": 0, + "OpenGL": 1, + "OpenGLES": 2 + } + } + Property { name: "majorVersion"; type: "int"; isReadonly: true } + Property { name: "minorVersion"; type: "int"; isReadonly: true } + Property { name: "profile"; type: "ContextProfile"; isReadonly: true } + Property { name: "renderableType"; type: "RenderableType"; isReadonly: true } + } Component { name: "QQuickPackage" defaultProperty: "data" @@ -3226,8 +3374,8 @@ Module { name: "QQuickShaderEffect" defaultProperty: "data" prototype: "QQuickItem" - exports: ["QtQuick/ShaderEffect 2.0"] - exportMetaObjectRevisions: [0] + exports: ["QtQuick/ShaderEffect 2.0", "QtQuick/ShaderEffect 2.4"] + exportMetaObjectRevisions: [0, 1] Enum { name: "CullMode" values: { @@ -3251,6 +3399,7 @@ Module { Property { name: "cullMode"; type: "CullMode" } Property { name: "log"; type: "string"; isReadonly: true } Property { name: "status"; type: "Status"; isReadonly: true } + Property { name: "supportsAtlasTextures"; revision: 1; type: "bool" } } Component { name: "QQuickShaderEffectMesh" @@ -3982,6 +4131,13 @@ Module { revision: 2 Parameter { name: "text"; type: "string" } } + Method { + name: "inputMethodQuery" + revision: 4 + type: "QVariant" + Parameter { name: "query"; type: "Qt::InputMethodQuery" } + Parameter { name: "argument"; type: "QVariant" } + } Method { name: "positionToRectangle" type: "QRectF" @@ -4026,8 +4182,12 @@ Module { name: "QQuickTextInput" defaultProperty: "data" prototype: "QQuickImplicitSizeItem" - exports: ["QtQuick/TextInput 2.0", "QtQuick/TextInput 2.2"] - exportMetaObjectRevisions: [0, 2] + exports: [ + "QtQuick/TextInput 2.0", + "QtQuick/TextInput 2.2", + "QtQuick/TextInput 2.4" + ] + exportMetaObjectRevisions: [0, 2, 3] Enum { name: "EchoMode" values: { @@ -4110,6 +4270,7 @@ Module { Property { name: "echoMode"; type: "EchoMode" } Property { name: "activeFocusOnPress"; type: "bool" } Property { name: "passwordCharacter"; type: "string" } + Property { name: "passwordMaskDelay"; revision: 3; type: "int" } Property { name: "displayText"; type: "string"; isReadonly: true } Property { name: "autoScroll"; type: "bool" } Property { name: "selectByMouse"; type: "bool" } @@ -4156,6 +4317,11 @@ Module { name: "echoModeChanged" Parameter { name: "echoMode"; type: "EchoMode" } } + Signal { + name: "passwordMaskDelayChanged" + revision: 3 + Parameter { name: "delay"; type: "int" } + } Signal { name: "activeFocusOnPressChanged" Parameter { name: "activeFocusOnPress"; type: "bool" } @@ -4202,6 +4368,11 @@ Module { Parameter { name: "start"; type: "int" } Parameter { name: "end"; type: "int" } } + Method { + name: "ensureVisible" + revision: 3 + Parameter { name: "position"; type: "int" } + } Method { name: "positionAt" Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } @@ -4220,6 +4391,13 @@ Module { Parameter { name: "pos"; type: "int" } Parameter { name: "mode"; type: "SelectionMode" } } + Method { + name: "inputMethodQuery" + revision: 3 + type: "QVariant" + Parameter { name: "query"; type: "Qt::InputMethodQuery" } + Parameter { name: "argument"; type: "QVariant" } + } Method { name: "getText" type: "string" @@ -4236,6 +4414,23 @@ Module { Property { name: "x"; type: "double" } Property { name: "y"; type: "double" } } + Component { + name: "QQuickTextMetrics" + prototype: "QObject" + exports: ["QtQuick/TextMetrics 2.4"] + exportMetaObjectRevisions: [0] + Property { name: "font"; type: "QFont" } + Property { name: "text"; type: "string" } + Property { name: "advanceWidth"; type: "double"; isReadonly: true } + Property { name: "boundingRect"; type: "QRectF"; isReadonly: true } + Property { name: "width"; type: "double"; isReadonly: true } + Property { name: "height"; type: "double"; isReadonly: true } + Property { name: "tightBoundingRect"; type: "QRectF"; isReadonly: true } + Property { name: "elidedText"; type: "string"; isReadonly: true } + Property { name: "elide"; type: "Qt::TextElideMode" } + Property { name: "elideWidth"; type: "double" } + Signal { name: "metricsChanged" } + } Component { name: "QQuickTouchPoint" prototype: "QObject" @@ -4779,7 +4974,8 @@ Module { "WA_TouchPadAcceptSingleTouchEvents": 123, "WA_X11DoNotAcceptFocus": 126, "WA_MacNoShadow": 127, - "WA_AttributeCount": 128 + "WA_AlwaysStackOnTop": 128, + "WA_AttributeCount": 129 } } Enum { @@ -4801,7 +4997,9 @@ Module { "AA_ForceRasterWidgets": 14, "AA_UseDesktopOpenGL": 15, "AA_UseOpenGLES": 16, - "AA_AttributeCount": 17 + "AA_UseSoftwareOpenGL": 17, + "AA_ShareOpenGLContexts": 18, + "AA_AttributeCount": 19 } } Enum { @@ -5246,6 +5444,13 @@ Module { "Key_Guide": 16777498, "Key_Info": 16777499, "Key_Settings": 16777500, + "Key_MicVolumeUp": 16777501, + "Key_MicVolumeDown": 16777502, + "Key_New": 16777504, + "Key_Open": 16777505, + "Key_Find": 16777506, + "Key_Undo": 16777507, + "Key_Redo": 16777508, "Key_MediaLast": 16842751, "Key_Select": 16842752, "Key_Yes": 16842753, @@ -5581,6 +5786,20 @@ Module { "ZAxis": 2 } } + Enum { + name: "FocusReason" + values: { + "MouseFocusReason": 0, + "TabFocusReason": 1, + "BacktabFocusReason": 2, + "ActiveWindowFocusReason": 3, + "PopupFocusReason": 4, + "ShortcutFocusReason": 5, + "MenuBarFocusReason": 6, + "OtherFocusReason": 7, + "NoFocusReason": 8 + } + } Enum { name: "ContextMenuPolicy" values: { @@ -5830,6 +6049,18 @@ Module { "LastGestureType": -1 } } + Enum { + name: "NativeGestureType" + values: { + "BeginNativeGesture": 0, + "EndNativeGesture": 1, + "PanNativeGesture": 2, + "ZoomNativeGesture": 3, + "SmartZoomNativeGesture": 4, + "RotateNativeGesture": 5, + "SwipeNativeGesture": 6 + } + } Enum { name: "CursorMoveStyle" values: { @@ -5853,6 +6084,14 @@ Module { "ScrollEnd": 3 } } + Enum { + name: "MouseEventSource" + values: { + "MouseEventNotSynthesized": 0, + "MouseEventSynthesizedBySystem": 1, + "MouseEventSynthesizedByQt": 2 + } + } } Component { name: "QEasingCurve"; prototype: "QQmlEasingValueType" } } diff --git a/src/imports/testlib/plugins.qmltypes b/src/imports/testlib/plugins.qmltypes index 94203df4dc..ce90ee0a57 100644 --- a/src/imports/testlib/plugins.qmltypes +++ b/src/imports/testlib/plugins.qmltypes @@ -250,6 +250,12 @@ Module { type: "QObject*" Parameter { name: "item"; type: "QQuickItem"; isPointer: true } } + Method { + name: "findChild" + type: "QObject*" + Parameter { name: "parent"; type: "QObject"; isPointer: true } + Parameter { name: "objectName"; type: "string" } + } } Component { name: "QuickTestUtil" diff --git a/src/imports/window/plugins.qmltypes b/src/imports/window/plugins.qmltypes index 27c0299c32..fa320886db 100644 --- a/src/imports/window/plugins.qmltypes +++ b/src/imports/window/plugins.qmltypes @@ -38,8 +38,10 @@ Module { Property { name: "desktopAvailableHeight"; type: "int"; isReadonly: true } Property { name: "logicalPixelDensity"; type: "double"; isReadonly: true } Property { name: "pixelDensity"; type: "double"; isReadonly: true } + Property { name: "devicePixelRatio"; type: "double"; isReadonly: true } Property { name: "primaryOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true } Property { name: "orientation"; type: "Qt::ScreenOrientation"; isReadonly: true } + Property { name: "orientationUpdateMask"; type: "Qt::ScreenOrientations" } Signal { name: "desktopGeometryChanged" } Method { name: "angleBetween" @@ -103,12 +105,21 @@ Module { Method { name: "update" } Method { name: "releaseResources" } } + Component { + name: "QQuickWindowAttached" + prototype: "QObject" + Property { name: "visibility"; type: "QWindow::Visibility"; isReadonly: true } + Property { name: "active"; type: "bool"; isReadonly: true } + Property { name: "activeFocusItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } + } Component { name: "QQuickWindowQmlImpl" defaultProperty: "data" prototype: "QQuickWindow" - exports: ["QtQuick.Window/Window 2.1"] - exportMetaObjectRevisions: [0] + exports: ["QtQuick.Window/Window 2.1", "QtQuick.Window/Window 2.2"] + exportMetaObjectRevisions: [0, 1] + attachedType: "QQuickWindowAttached" Property { name: "visible"; type: "bool" } Property { name: "visibility"; type: "Visibility" } Signal { diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h index 5d1c026c5c..da88fd4917 100644 --- a/src/quick/items/qquicktextedit_p.h +++ b/src/quick/items/qquicktextedit_p.h @@ -221,7 +221,7 @@ public: #ifndef QT_NO_IM QVariant inputMethodQuery(Qt::InputMethodQuery property) const; - Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; + Q_REVISION(4) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif qreal contentWidth() const; diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index 2386fc5642..34b0c81495 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -246,7 +246,7 @@ public: #ifndef QT_NO_IM QVariant inputMethodQuery(Qt::InputMethodQuery property) const; - Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; + Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif QRectF boundingRect() const; -- cgit v1.2.3 From 6601789fd75dfe1abe294e45b97b5433a7f52465 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Thu, 4 Dec 2014 18:00:40 +0100 Subject: qttest: make findChild available only for QtTest 1.1 Change-Id: I4ceb1a969bd4296b82f899088b02b5e8cf100bcd Reviewed-by: Simon Hausmann --- examples/qmltest/qmltest/tst_basic.qml | 4 ++-- examples/qmltest/qmltest/tst_item.qml | 4 ++-- src/imports/testlib/SignalSpy.qml | 2 +- src/imports/testlib/TestCase.qml | 4 ++-- src/imports/testlib/main.cpp | 3 ++- src/imports/testlib/plugins.qmltypes | 11 ++++++----- src/qmltest/quicktestresult_p.h | 2 +- src/quick/doc/src/qmltypereference.qdoc | 4 ++-- tests/auto/qmltest/animatedimage/tst_animatedimage.qml | 2 +- .../auto/qmltest/animations/tst_abstractanimationjobcrash.qml | 2 +- tests/auto/qmltest/animators/tst_behavior.qml | 2 +- tests/auto/qmltest/animators/tst_mixed.qml | 2 +- tests/auto/qmltest/animators/tst_mixedparallel.qml | 2 +- tests/auto/qmltest/animators/tst_mixedsequential.qml | 2 +- tests/auto/qmltest/animators/tst_multiwindow.qml | 2 +- tests/auto/qmltest/animators/tst_nested.qml | 2 +- tests/auto/qmltest/animators/tst_on.qml | 2 +- tests/auto/qmltest/animators/tst_opacity.qml | 2 +- tests/auto/qmltest/animators/tst_parallel.qml | 2 +- tests/auto/qmltest/animators/tst_restart.qml | 2 +- tests/auto/qmltest/animators/tst_rotation.qml | 2 +- tests/auto/qmltest/animators/tst_scale.qml | 2 +- tests/auto/qmltest/animators/tst_sequential.qml | 2 +- tests/auto/qmltest/animators/tst_targetdestroyed.qml | 2 +- tests/auto/qmltest/animators/tst_transformorigin.qml | 2 +- tests/auto/qmltest/animators/tst_transition.qml | 2 +- tests/auto/qmltest/animators/tst_x.qml | 2 +- tests/auto/qmltest/animators/tst_y.qml | 2 +- tests/auto/qmltest/borderimage/tst_borderimage.qml | 2 +- tests/auto/qmltest/buttonclick/tst_buttonclick.qml | 2 +- tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml | 2 +- tests/auto/qmltest/events/tst_drag.qml | 2 +- tests/auto/qmltest/events/tst_events.qml | 2 +- tests/auto/qmltest/events/tst_wheel.qml | 2 +- tests/auto/qmltest/fontloader/tst_fontloader.qml | 2 +- tests/auto/qmltest/gradient/tst_gradient.qml | 2 +- tests/auto/qmltest/image/tst_image.qml | 2 +- tests/auto/qmltest/item/tst_layerInPositioner.qml | 2 +- tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml | 2 +- tests/auto/qmltest/listmodel/tst_listmodel.qml | 2 +- tests/auto/qmltest/listview/tst_listview.qml | 2 +- tests/auto/qmltest/pathview/tst_pathview.qml | 2 +- tests/auto/qmltest/pixel/tst_pixel.qml | 2 +- tests/auto/qmltest/qqmlbinding/tst_binding.qml | 2 +- tests/auto/qmltest/qqmlbinding/tst_binding2.qml | 2 +- tests/auto/qmltest/rectangle/tst_rectangle.qml | 2 +- tests/auto/qmltest/selftests/tst_compare.qml | 2 +- tests/auto/qmltest/selftests/tst_compare_quickobjects.qml | 2 +- tests/auto/qmltest/selftests/tst_datadriven.qml | 2 +- tests/auto/qmltest/selftests/tst_destroy.qml | 2 +- tests/auto/qmltest/selftests/tst_findChild.qml | 2 +- tests/auto/qmltest/selftests/tst_selftests.qml | 2 +- tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml | 2 +- .../qmltest/shadersource/tst_DynamicallyCreatedSource.qml | 2 +- tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml | 2 +- tests/auto/qmltest/shadersource/tst_SourceItem.qml | 2 +- .../auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml | 2 +- tests/auto/qmltest/stability/tst_unloadrepeater.qml | 2 +- tests/auto/qmltest/statemachine/tst_anonymousstate.qml | 2 +- tests/auto/qmltest/statemachine/tst_guardcondition.qml | 2 +- tests/auto/qmltest/statemachine/tst_historystate.qml | 2 +- tests/auto/qmltest/statemachine/tst_initialstate.qml | 2 +- tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml | 2 +- tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml | 2 +- tests/auto/qmltest/statemachine/tst_parallelmachine.qml | 2 +- tests/auto/qmltest/statemachine/tst_trafficlight.qml | 2 +- tests/auto/qmltest/text/tst_text.qml | 2 +- tests/auto/qmltest/textedit/tst_textedit.qml | 2 +- tests/auto/qmltest/textinput/tst_textinput.qml | 2 +- .../qquickanimationcontroller/data/tst_coloranimation.qml | 2 +- .../quick/qquickanimationcontroller/data/tst_completion.qml | 2 +- .../qquickanimationcontroller/data/tst_numberanimation.qml | 2 +- .../qquickanimationcontroller/data/tst_parallelanimation.qml | 2 +- .../data/tst_sequentialanimation.qml | 2 +- tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml | 2 +- tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml | 2 +- tests/auto/quick/qquickcanvasitem/data/tst_context.qml | 2 +- tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml | 2 +- .../data/outsideViewportChangeNotAffectingView.qml | 2 +- 79 files changed, 89 insertions(+), 87 deletions(-) diff --git a/examples/qmltest/qmltest/tst_basic.qml b/examples/qmltest/qmltest/tst_basic.qml index ba5ebe935a..1d9efbab61 100644 --- a/examples/qmltest/qmltest/tst_basic.qml +++ b/examples/qmltest/qmltest/tst_basic.qml @@ -31,8 +31,8 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtTest 1.0 +import QtQuick 2.4 +import QtTest 1.1 TestCase { name: "BasicTests" diff --git a/examples/qmltest/qmltest/tst_item.qml b/examples/qmltest/qmltest/tst_item.qml index 69e2b83a00..966d7e1bfe 100644 --- a/examples/qmltest/qmltest/tst_item.qml +++ b/examples/qmltest/qmltest/tst_item.qml @@ -31,8 +31,8 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtTest 1.0 +import QtQuick 2.4 +import QtTest 1.1 Rectangle { id: foo diff --git a/src/imports/testlib/SignalSpy.qml b/src/imports/testlib/SignalSpy.qml index 547f403bab..e483e6f71f 100644 --- a/src/imports/testlib/SignalSpy.qml +++ b/src/imports/testlib/SignalSpy.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 /*! \qmltype SignalSpy diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 700c9112eb..160e0bdb62 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 import "testlogger.js" as TestLogger import Qt.test.qtestroot 1.0 @@ -101,7 +101,7 @@ import Qt.test.qtestroot 1.0 \code import QtQuick 2.0 - import QtTest 1.0 + import QtTest 1.1 TestCase { name: "DataTests" diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index 59002ba09b..6e28101530 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -140,7 +140,8 @@ public: virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtTest")); - qmlRegisterType(uri,1,0,"TestResult"); + qmlRegisterType(uri,1,0,"TestResult"); + qmlRegisterType(uri,1,1,"TestResult"); qmlRegisterType(uri,1,0,"TestEvent"); qmlRegisterType(uri,1,0,"TestUtil"); } diff --git a/src/imports/testlib/plugins.qmltypes b/src/imports/testlib/plugins.qmltypes index ce90ee0a57..a892f73eb0 100644 --- a/src/imports/testlib/plugins.qmltypes +++ b/src/imports/testlib/plugins.qmltypes @@ -4,13 +4,13 @@ import QtQuick.tooling 1.1 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtTest 1.0' +// 'qmlplugindump QtTest 1.1' Module { Component { name: "QuickTestEvent" prototype: "QObject" - exports: ["QtTest/TestEvent 1.0"] + exports: ["TestEvent 1.0"] exportMetaObjectRevisions: [0] Method { name: "keyPress" @@ -119,8 +119,8 @@ Module { Component { name: "QuickTestResult" prototype: "QObject" - exports: ["QtTest/TestResult 1.0"] - exportMetaObjectRevisions: [0] + exports: ["TestResult 1.0", "TestResult 1.1"] + exportMetaObjectRevisions: [0, 1] Enum { name: "RunMode" values: { @@ -252,6 +252,7 @@ Module { } Method { name: "findChild" + revision: 1 type: "QObject*" Parameter { name: "parent"; type: "QObject"; isPointer: true } Parameter { name: "objectName"; type: "string" } @@ -260,7 +261,7 @@ Module { Component { name: "QuickTestUtil" prototype: "QObject" - exports: ["QtTest/TestUtil 1.0"] + exports: ["TestUtil 1.0"] exportMetaObjectRevisions: [0] Property { name: "printAvailableFunctions"; type: "bool"; isReadonly: true } Property { name: "dragThreshold"; type: "int"; isReadonly: true } diff --git a/src/qmltest/quicktestresult_p.h b/src/qmltest/quicktestresult_p.h index 78d0501b7c..0da29e8bd4 100644 --- a/src/qmltest/quicktestresult_p.h +++ b/src/qmltest/quicktestresult_p.h @@ -139,7 +139,7 @@ public Q_SLOTS: QObject *grabImage(QQuickItem *item); - QObject *findChild(QObject *parent, const QString &objectName); + Q_REVISION(1) QObject *findChild(QObject *parent, const QString &objectName); public: // Helper functions for the C++ main() shell. diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index cc602d4aee..430c0ed11a 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -830,14 +830,14 @@ console.log(c + " " + d); // false true */ /*! -\qmlmodule QtTest 1.0 +\qmlmodule QtTest 1.1 \title Qt Quick Test QML Types \brief This module provides QML types to unit test your QML application \ingroup qmlmodules You can import this module using the following statement: \code -import QtTest 1.0 +import QtTest 1.1 \endcode For more information about how to use these types, see diff --git a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml index d0574da4f5..a58a19fa58 100644 --- a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml +++ b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml b/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml index 6d4b17f83e..008f0ad445 100644 --- a/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml +++ b/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { Rectangle { diff --git a/tests/auto/qmltest/animators/tst_behavior.qml b/tests/auto/qmltest/animators/tst_behavior.qml index 87b0efff17..17b9bee0e2 100644 --- a/tests/auto/qmltest/animators/tst_behavior.qml +++ b/tests/auto/qmltest/animators/tst_behavior.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_mixed.qml b/tests/auto/qmltest/animators/tst_mixed.qml index 488f1c8156..1e3600f80f 100644 --- a/tests/auto/qmltest/animators/tst_mixed.qml +++ b/tests/auto/qmltest/animators/tst_mixed.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_mixedparallel.qml b/tests/auto/qmltest/animators/tst_mixedparallel.qml index 2b6ebfc17a..51372008e1 100644 --- a/tests/auto/qmltest/animators/tst_mixedparallel.qml +++ b/tests/auto/qmltest/animators/tst_mixedparallel.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_mixedsequential.qml b/tests/auto/qmltest/animators/tst_mixedsequential.qml index 6165cf5438..d1b0f92f59 100644 --- a/tests/auto/qmltest/animators/tst_mixedsequential.qml +++ b/tests/auto/qmltest/animators/tst_mixedsequential.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_multiwindow.qml b/tests/auto/qmltest/animators/tst_multiwindow.qml index de73434aab..f0f42725ba 100644 --- a/tests/auto/qmltest/animators/tst_multiwindow.qml +++ b/tests/auto/qmltest/animators/tst_multiwindow.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 import QtQuick.Window 2.0 Item { diff --git a/tests/auto/qmltest/animators/tst_nested.qml b/tests/auto/qmltest/animators/tst_nested.qml index 0426dd96e7..fba5d8350d 100644 --- a/tests/auto/qmltest/animators/tst_nested.qml +++ b/tests/auto/qmltest/animators/tst_nested.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_on.qml b/tests/auto/qmltest/animators/tst_on.qml index d6be945723..e82711bb50 100644 --- a/tests/auto/qmltest/animators/tst_on.qml +++ b/tests/auto/qmltest/animators/tst_on.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_opacity.qml b/tests/auto/qmltest/animators/tst_opacity.qml index 37603a9ced..94f639e30c 100644 --- a/tests/auto/qmltest/animators/tst_opacity.qml +++ b/tests/auto/qmltest/animators/tst_opacity.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_parallel.qml b/tests/auto/qmltest/animators/tst_parallel.qml index 7702dd7dd8..074c7442f7 100644 --- a/tests/auto/qmltest/animators/tst_parallel.qml +++ b/tests/auto/qmltest/animators/tst_parallel.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_restart.qml b/tests/auto/qmltest/animators/tst_restart.qml index 3bacf6cb6a..fd9bd46c46 100644 --- a/tests/auto/qmltest/animators/tst_restart.qml +++ b/tests/auto/qmltest/animators/tst_restart.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_rotation.qml b/tests/auto/qmltest/animators/tst_rotation.qml index 9ff4278527..deb6006801 100644 --- a/tests/auto/qmltest/animators/tst_rotation.qml +++ b/tests/auto/qmltest/animators/tst_rotation.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_scale.qml b/tests/auto/qmltest/animators/tst_scale.qml index 10f3430c84..62f8fe1264 100644 --- a/tests/auto/qmltest/animators/tst_scale.qml +++ b/tests/auto/qmltest/animators/tst_scale.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_sequential.qml b/tests/auto/qmltest/animators/tst_sequential.qml index 9841413f70..232d084481 100644 --- a/tests/auto/qmltest/animators/tst_sequential.qml +++ b/tests/auto/qmltest/animators/tst_sequential.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_targetdestroyed.qml b/tests/auto/qmltest/animators/tst_targetdestroyed.qml index 92b14d0594..92ed3bda3e 100644 --- a/tests/auto/qmltest/animators/tst_targetdestroyed.qml +++ b/tests/auto/qmltest/animators/tst_targetdestroyed.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_transformorigin.qml b/tests/auto/qmltest/animators/tst_transformorigin.qml index bd3483dad5..d11e2040ba 100644 --- a/tests/auto/qmltest/animators/tst_transformorigin.qml +++ b/tests/auto/qmltest/animators/tst_transformorigin.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_transition.qml b/tests/auto/qmltest/animators/tst_transition.qml index 67230d2adf..c5becfe68b 100644 --- a/tests/auto/qmltest/animators/tst_transition.qml +++ b/tests/auto/qmltest/animators/tst_transition.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_x.qml b/tests/auto/qmltest/animators/tst_x.qml index 35e410e8e2..32f2eac75d 100644 --- a/tests/auto/qmltest/animators/tst_x.qml +++ b/tests/auto/qmltest/animators/tst_x.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/animators/tst_y.qml b/tests/auto/qmltest/animators/tst_y.qml index 79fd50e8bf..792cc91782 100644 --- a/tests/auto/qmltest/animators/tst_y.qml +++ b/tests/auto/qmltest/animators/tst_y.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/borderimage/tst_borderimage.qml b/tests/auto/qmltest/borderimage/tst_borderimage.qml index 49b4397ea9..91b0310009 100644 --- a/tests/auto/qmltest/borderimage/tst_borderimage.qml +++ b/tests/auto/qmltest/borderimage/tst_borderimage.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/buttonclick/tst_buttonclick.qml b/tests/auto/qmltest/buttonclick/tst_buttonclick.qml index aead8b91f2..18882587a9 100644 --- a/tests/auto/qmltest/buttonclick/tst_buttonclick.qml +++ b/tests/auto/qmltest/buttonclick/tst_buttonclick.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Button { id: button diff --git a/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml b/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml index f504c8f901..8da6fb1150 100644 --- a/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml +++ b/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 TestCase { id: top diff --git a/tests/auto/qmltest/events/tst_drag.qml b/tests/auto/qmltest/events/tst_drag.qml index 76682ab6fb..1665a8e0ae 100644 --- a/tests/auto/qmltest/events/tst_drag.qml +++ b/tests/auto/qmltest/events/tst_drag.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle{ id: root diff --git a/tests/auto/qmltest/events/tst_events.qml b/tests/auto/qmltest/events/tst_events.qml index 1ae5d5fbb2..ea6e4ea4fb 100644 --- a/tests/auto/qmltest/events/tst_events.qml +++ b/tests/auto/qmltest/events/tst_events.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { width: 50; height: 50 diff --git a/tests/auto/qmltest/events/tst_wheel.qml b/tests/auto/qmltest/events/tst_wheel.qml index 707b5d46bb..8504939633 100644 --- a/tests/auto/qmltest/events/tst_wheel.qml +++ b/tests/auto/qmltest/events/tst_wheel.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id:top diff --git a/tests/auto/qmltest/fontloader/tst_fontloader.qml b/tests/auto/qmltest/fontloader/tst_fontloader.qml index be24bb603d..ea0d8bc7f4 100644 --- a/tests/auto/qmltest/fontloader/tst_fontloader.qml +++ b/tests/auto/qmltest/fontloader/tst_fontloader.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.1 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/gradient/tst_gradient.qml b/tests/auto/qmltest/gradient/tst_gradient.qml index c25ac19e84..1e9f7d4373 100644 --- a/tests/auto/qmltest/gradient/tst_gradient.qml +++ b/tests/auto/qmltest/gradient/tst_gradient.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/image/tst_image.qml b/tests/auto/qmltest/image/tst_image.qml index 1afa5f8274..a507dfe508 100644 --- a/tests/auto/qmltest/image/tst_image.qml +++ b/tests/auto/qmltest/image/tst_image.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/item/tst_layerInPositioner.qml b/tests/auto/qmltest/item/tst_layerInPositioner.qml index 706c895264..69f29be269 100644 --- a/tests/auto/qmltest/item/tst_layerInPositioner.qml +++ b/tests/auto/qmltest/item/tst_layerInPositioner.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.4 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml index 4e60e2d8d6..1a79cb4935 100644 --- a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml +++ b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.4 -import QtTest 1.0 +import QtTest 1.1 Item { id: root; diff --git a/tests/auto/qmltest/listmodel/tst_listmodel.qml b/tests/auto/qmltest/listmodel/tst_listmodel.qml index 603993a092..aae9ec42ec 100644 --- a/tests/auto/qmltest/listmodel/tst_listmodel.qml +++ b/tests/auto/qmltest/listmodel/tst_listmodel.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml index 069b62a726..7b7242d17d 100644 --- a/tests/auto/qmltest/listview/tst_listview.qml +++ b/tests/auto/qmltest/listview/tst_listview.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.1 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/pathview/tst_pathview.qml b/tests/auto/qmltest/pathview/tst_pathview.qml index 820034c960..a6b440e0b8 100644 --- a/tests/auto/qmltest/pathview/tst_pathview.qml +++ b/tests/auto/qmltest/pathview/tst_pathview.qml @@ -1,5 +1,5 @@ import QtQuick 2.1 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/pixel/tst_pixel.qml b/tests/auto/qmltest/pixel/tst_pixel.qml index 6e4055b367..9b0b9e57c1 100644 --- a/tests/auto/qmltest/pixel/tst_pixel.qml +++ b/tests/auto/qmltest/pixel/tst_pixel.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id:rect diff --git a/tests/auto/qmltest/qqmlbinding/tst_binding.qml b/tests/auto/qmltest/qqmlbinding/tst_binding.qml index 81f9c04b55..35cf7e071d 100644 --- a/tests/auto/qmltest/qqmlbinding/tst_binding.qml +++ b/tests/auto/qmltest/qqmlbinding/tst_binding.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id: screen diff --git a/tests/auto/qmltest/qqmlbinding/tst_binding2.qml b/tests/auto/qmltest/qqmlbinding/tst_binding2.qml index b1f2143751..944f88b072 100644 --- a/tests/auto/qmltest/qqmlbinding/tst_binding2.qml +++ b/tests/auto/qmltest/qqmlbinding/tst_binding2.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id: screen diff --git a/tests/auto/qmltest/rectangle/tst_rectangle.qml b/tests/auto/qmltest/rectangle/tst_rectangle.qml index caf40cdb26..a0a6ee4862 100644 --- a/tests/auto/qmltest/rectangle/tst_rectangle.qml +++ b/tests/auto/qmltest/rectangle/tst_rectangle.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/selftests/tst_compare.qml b/tests/auto/qmltest/selftests/tst_compare.qml index efb4ce0349..2c1ecb5223 100644 --- a/tests/auto/qmltest/selftests/tst_compare.qml +++ b/tests/auto/qmltest/selftests/tst_compare.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 TestCase { name: "SelfTests_compare" diff --git a/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml b/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml index f246f0b116..de652ae044 100644 --- a/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml +++ b/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 TestCase { name: "SelfTests_compare_QuickObjects" diff --git a/tests/auto/qmltest/selftests/tst_datadriven.qml b/tests/auto/qmltest/selftests/tst_datadriven.qml index cc3afc43b5..a371bc9034 100644 --- a/tests/auto/qmltest/selftests/tst_datadriven.qml +++ b/tests/auto/qmltest/selftests/tst_datadriven.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { TestCase { diff --git a/tests/auto/qmltest/selftests/tst_destroy.qml b/tests/auto/qmltest/selftests/tst_destroy.qml index 764f21ecbc..d943c5ed7a 100644 --- a/tests/auto/qmltest/selftests/tst_destroy.qml +++ b/tests/auto/qmltest/selftests/tst_destroy.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.1 -import QtTest 1.0 +import QtTest 1.1 TestCase { id: testCase diff --git a/tests/auto/qmltest/selftests/tst_findChild.qml b/tests/auto/qmltest/selftests/tst_findChild.qml index 69bcb390e9..ae0b24e0de 100644 --- a/tests/auto/qmltest/selftests/tst_findChild.qml +++ b/tests/auto/qmltest/selftests/tst_findChild.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 TestCase { name: "tst_findChild" diff --git a/tests/auto/qmltest/selftests/tst_selftests.qml b/tests/auto/qmltest/selftests/tst_selftests.qml index 5d91141429..167c21774a 100644 --- a/tests/auto/qmltest/selftests/tst_selftests.qml +++ b/tests/auto/qmltest/selftests/tst_selftests.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 TestCase { name: "SelfTests" diff --git a/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml b/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml index bbfa08f443..689f04aa04 100644 --- a/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml +++ b/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml @@ -33,7 +33,7 @@ import QtQuick 2.2 import QtQuick.Window 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { width: 100 diff --git a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml index 2042afa2c5..c04aab3c01 100644 --- a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml +++ b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: root diff --git a/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml b/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml index b00cfbc5f8..81aac5fb9e 100644 --- a/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml +++ b/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml @@ -34,7 +34,7 @@ import QtQuick 2.0 import QtQuick.Window 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { width: 100 diff --git a/tests/auto/qmltest/shadersource/tst_SourceItem.qml b/tests/auto/qmltest/shadersource/tst_SourceItem.qml index 822b53d6fa..bde6ce2a0b 100644 --- a/tests/auto/qmltest/shadersource/tst_SourceItem.qml +++ b/tests/auto/qmltest/shadersource/tst_SourceItem.qml @@ -32,7 +32,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: root diff --git a/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml b/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml index 4fb08a02f6..48f1f3ecc2 100644 --- a/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml +++ b/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml @@ -34,7 +34,7 @@ import QtQuick 2.0 import QtQuick.Window 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { Rectangle { diff --git a/tests/auto/qmltest/stability/tst_unloadrepeater.qml b/tests/auto/qmltest/stability/tst_unloadrepeater.qml index dfb631493b..62811ddabc 100644 --- a/tests/auto/qmltest/stability/tst_unloadrepeater.qml +++ b/tests/auto/qmltest/stability/tst_unloadrepeater.qml @@ -40,7 +40,7 @@ ****************************************************************************/ import QtQuick 2.2 -import QtTest 1.0 +import QtTest 1.1 Item { width : 800 diff --git a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml index b05d5c67a9..e5fab06409 100644 --- a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml +++ b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml @@ -31,7 +31,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/statemachine/tst_guardcondition.qml b/tests/auto/qmltest/statemachine/tst_guardcondition.qml index 0390b5f8fa..abe348aa8d 100644 --- a/tests/auto/qmltest/statemachine/tst_guardcondition.qml +++ b/tests/auto/qmltest/statemachine/tst_guardcondition.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/statemachine/tst_historystate.qml b/tests/auto/qmltest/statemachine/tst_historystate.qml index 6e2aa70417..1da554c9bb 100644 --- a/tests/auto/qmltest/statemachine/tst_historystate.qml +++ b/tests/auto/qmltest/statemachine/tst_historystate.qml @@ -31,7 +31,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/statemachine/tst_initialstate.qml b/tests/auto/qmltest/statemachine/tst_initialstate.qml index c08b3f7001..a1fa6f2d55 100644 --- a/tests/auto/qmltest/statemachine/tst_initialstate.qml +++ b/tests/auto/qmltest/statemachine/tst_initialstate.qml @@ -31,7 +31,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml index 443771f8f4..792ddd33bc 100644 --- a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml +++ b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml @@ -31,7 +31,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml index f584b7cd01..f123f3f3af 100644 --- a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml +++ b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml @@ -31,7 +31,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml index 2e3a5efdfd..1926b100b6 100644 --- a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml +++ b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml @@ -31,7 +31,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/statemachine/tst_trafficlight.qml b/tests/auto/qmltest/statemachine/tst_trafficlight.qml index 3f731a4014..6e2eebb354 100644 --- a/tests/auto/qmltest/statemachine/tst_trafficlight.qml +++ b/tests/auto/qmltest/statemachine/tst_trafficlight.qml @@ -31,7 +31,7 @@ ** ****************************************************************************/ -import QtTest 1.0 +import QtTest 1.1 import QtQml.StateMachine 1.0 TestCase { diff --git a/tests/auto/qmltest/text/tst_text.qml b/tests/auto/qmltest/text/tst_text.qml index b1d743f630..772d9987bc 100644 --- a/tests/auto/qmltest/text/tst_text.qml +++ b/tests/auto/qmltest/text/tst_text.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/textedit/tst_textedit.qml b/tests/auto/qmltest/textedit/tst_textedit.qml index 1dc7084049..a7fb2374b6 100644 --- a/tests/auto/qmltest/textedit/tst_textedit.qml +++ b/tests/auto/qmltest/textedit/tst_textedit.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/qmltest/textinput/tst_textinput.qml b/tests/auto/qmltest/textinput/tst_textinput.qml index 9a00ac8a60..4942665e9d 100644 --- a/tests/auto/qmltest/textinput/tst_textinput.qml +++ b/tests/auto/qmltest/textinput/tst_textinput.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Item { id: top diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml index 92e27b9945..8374552974 100755 --- a/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml +++ b/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id:container diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml index 48c4fb734c..1a8ca81ba0 100755 --- a/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml +++ b/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id:container diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml index 7c4496b206..c5f9860fe2 100644 --- a/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml +++ b/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id:container diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml index 1a17a1a908..87cba880af 100644 --- a/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml +++ b/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id:container diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml index 59671f5145..4098af14f2 100644 --- a/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml +++ b/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Rectangle { id:container diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml index 000888a36f..5be221042e 100644 --- a/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml +++ b/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Component { id:canvas diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml index c8c2f4960f..b0cae69fe3 100644 --- a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml +++ b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 import QtQuick.Window 2.1 TestCase { diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml index b18250291e..f266c16d76 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml @@ -1,6 +1,6 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 Canvas { id: canvas diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml b/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml index 487f7dc903..281264ba92 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtTest 1.0 +import QtTest 1.1 CanvasTestCase { id:testCase diff --git a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml index c57cde5eda..c5fb53a3de 100644 --- a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml +++ b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.1 -import QtTest 1.0 +import QtTest 1.1 Item { width: 300 -- cgit v1.2.3 From fdf004803d036583f58ceb832803cfe39c6ba6d8 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 2 Dec 2014 18:26:46 +0100 Subject: QQmlInspectorService: handle views only with supported plugins. Task-number: QTBUG-43048 Change-Id: I5b32bd0a1e28fdf56b5346580daf21e7ec1b9f8c Reviewed-by: Kevin Funk Reviewed-by: Kai Koehne --- src/qml/debugger/qqmlinspectorservice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qml/debugger/qqmlinspectorservice.cpp b/src/qml/debugger/qqmlinspectorservice.cpp index 31fa9bddef..89c2c17c45 100644 --- a/src/qml/debugger/qqmlinspectorservice.cpp +++ b/src/qml/debugger/qqmlinspectorservice.cpp @@ -106,6 +106,7 @@ void QQmlInspectorService::updateState() return; } + m_currentInspectorPlugin = 0; foreach (QQmlInspectorInterface *inspector, m_inspectorPlugins) { if (inspector->canHandleView(m_views.first())) { m_currentInspectorPlugin = inspector; -- cgit v1.2.3 From 6a0145dd664ab9f5e3703ab3d0f962b3f378d6c6 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Fri, 5 Dec 2014 20:14:20 +0100 Subject: Fix \inqmlmodule usage: only use one parameter Since the command just links back to the corresponding module page, only the first parameter is used, and the version causes more confusion. Change-Id: I73ed289550c576747132f77b83c1257094059cd1 Reviewed-by: Mitch Curtis --- src/imports/settings/qqmlsettings.cpp | 2 +- src/imports/xmllistmodel/qqmlxmllistmodel.cpp | 4 ++-- src/particles/qquickage.cpp | 2 +- src/particles/qquickangledirection.cpp | 2 +- src/particles/qquickcumulativedirection.cpp | 2 +- src/particles/qquickcustomparticle.cpp | 2 +- src/particles/qquickdirection.cpp | 2 +- src/particles/qquickellipseextruder.cpp | 2 +- src/particles/qquickfriction.cpp | 2 +- src/particles/qquickgravity.cpp | 2 +- src/particles/qquickgroupgoal.cpp | 2 +- src/particles/qquickimageparticle.cpp | 2 +- src/particles/qquickitemparticle.cpp | 2 +- src/particles/qquicklineextruder.cpp | 2 +- src/particles/qquickmaskextruder.cpp | 2 +- src/particles/qquickparticleaffector.cpp | 2 +- src/particles/qquickparticleemitter.cpp | 2 +- src/particles/qquickparticleextruder.cpp | 2 +- src/particles/qquickparticlegroup.cpp | 2 +- src/particles/qquickparticlepainter.cpp | 2 +- src/particles/qquickparticlesystem.cpp | 2 +- src/particles/qquickpointattractor.cpp | 2 +- src/particles/qquickpointdirection.cpp | 2 +- src/particles/qquickrectangleextruder.cpp | 2 +- src/particles/qquickspritegoal.cpp | 2 +- src/particles/qquicktargetdirection.cpp | 2 +- src/particles/qquicktrailemitter.cpp | 2 +- src/particles/qquickturbulence.cpp | 2 +- src/particles/qquickv4particledata.cpp | 2 +- src/particles/qquickwander.cpp | 2 +- src/qml/types/qqmldelegatemodel.cpp | 4 ++-- src/qml/types/qqmllistmodel.cpp | 4 ++-- src/qml/types/qqmlobjectmodel.cpp | 2 +- 33 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp index 65f091a9e4..5fdf40f0fc 100644 --- a/src/imports/settings/qqmlsettings.cpp +++ b/src/imports/settings/qqmlsettings.cpp @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE /*! \qmltype Settings \instantiates QQmlSettings - \inqmlmodule Qt.labs.settings 1.0 + \inqmlmodule Qt.labs.settings \ingroup settings \brief Provides persistent platform-independent application settings. diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp index e3678ec75b..225eedb578 100644 --- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp +++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp @@ -83,7 +83,7 @@ typedef QPair QQuickXmlListRange; /*! \qmltype XmlRole \instantiates QQuickXmlListModelRole - \inqmlmodule QtQuick.XmlListModel 2 + \inqmlmodule QtQuick.XmlListModel \brief For specifying a role to an XmlListModel \ingroup qtquick-models @@ -612,7 +612,7 @@ void QQuickXmlListModelPrivate::clear_role(QQmlListProperty Date: Sat, 6 Dec 2014 10:38:34 -0600 Subject: Avoid string-based connect in QQuickImageBase. String-based connect is relatively slow, and should be avoided in core items. This improves performance of the tst_librarymetrics_performance::instantiation_cached(043) image - empty test case (approximately halving the time). Task-number: QTBUG-43096 Change-Id: I02485c515435eceacc95c55f877fc8566e7406d7 Reviewed-by: Simon Hausmann --- src/quick/items/qquickimagebase.cpp | 10 +++++----- src/quick/items/qquickimagebase_p.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index 1a5d115a3c..a4c4af4e45 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -35,6 +35,7 @@ #include "qquickimagebase_p_p.h" #include +#include #include #include @@ -45,14 +46,12 @@ QQuickImageBase::QQuickImageBase(QQuickItem *parent) : QQuickImplicitSizeItem(*(new QQuickImageBasePrivate), parent) { setFlag(ItemHasContents); - connect(this, SIGNAL(windowChanged(QQuickWindow*)), SLOT(handleWindowChanged(QQuickWindow*))); } QQuickImageBase::QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent) : QQuickImplicitSizeItem(dd, parent) { setFlag(ItemHasContents); - connect(this, SIGNAL(windowChanged(QQuickWindow*)), SLOT(handleWindowChanged(QQuickWindow*))); } QQuickImageBase::~QQuickImageBase() @@ -278,10 +277,11 @@ void QQuickImageBase::requestProgress(qint64 received, qint64 total) } } -void QQuickImageBase::handleWindowChanged(QQuickWindow* window) +void QQuickImageBase::itemChange(ItemChange change, const ItemChangeData &value) { - if (window) - connect(window, SIGNAL(screenChanged(QScreen*)), this, SLOT(handleScreenChanged(QScreen*))); + if (change == ItemSceneChange && value.window) + connect(value.window, &QQuickWindow::screenChanged, this, &QQuickImageBase::handleScreenChanged); + QQuickItem::itemChange(change, value); } void QQuickImageBase::handleScreenChanged(QScreen* screen) diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h index 4446268a2b..2750db8873 100644 --- a/src/quick/items/qquickimagebase_p.h +++ b/src/quick/items/qquickimagebase_p.h @@ -93,12 +93,12 @@ protected: virtual void load(); virtual void componentComplete(); virtual void pixmapChange(); + void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent); private Q_SLOTS: virtual void requestFinished(); void requestProgress(qint64,qint64); - void handleWindowChanged(QQuickWindow *window); void handleScreenChanged(QScreen *screen); private: -- cgit v1.2.3 From ff3962001b20fdc6e9946fbf05d39a456561a9ed Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 8 Dec 2014 10:22:47 +0100 Subject: Quick: fix test /Users/erik/dev/qt5-stable/qtdeclarative/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp:1561:60: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] items << qMakePair(QString("new item " + j), QString::number(j)); ~~~~~~~~~~~~^~~ Change-Id: I94bd952abf82a8f174772482330b5fdd636578ad Reviewed-by: Simon Hausmann --- tests/auto/quick/qquickgridview/tst_qquickgridview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index 123d7f5032..efd9ab12fe 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -1558,7 +1558,7 @@ void tst_QQuickGridView::multipleChanges(bool condensed) { QList > items; for (int j=changes[i].index; j Date: Mon, 8 Dec 2014 10:24:06 +0100 Subject: QML: fix warning in tests Remove unused class field. Change-Id: I90981546e33d4839a91c418a8746e6f2ebc3bf46 Reviewed-by: Simon Hausmann --- .../tst_qqmlenginedebuginspectorintegration.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index c4c2705e01..e4c14a2e10 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -54,7 +54,6 @@ class tst_QQmlEngineDebugInspectorIntegration : public QQmlDataTest public: tst_QQmlEngineDebugInspectorIntegration() : m_process(0) - , m_connection(0) , m_inspectorClient(0) , m_engineDebugClient(0) { @@ -65,7 +64,6 @@ private: QmlDebugObjectReference findRootObject(); QQmlDebugProcess *m_process; - QQmlDebugConnection *m_connection; QQmlInspectorClient *m_inspectorClient; QQmlEngineDebugClient *m_engineDebugClient; -- cgit v1.2.3 From 3f9ecd866df32c1f0f332c89646392bfeddf9d74 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 8 Dec 2014 10:24:42 +0100 Subject: QML: fix warning in tests Remove unused constant. Change-Id: I3fb3512f7ea54102450eeeda1a56c73fe6b26025 Reviewed-by: Simon Hausmann --- tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp index deb3f4e11b..1cdf8ce574 100644 --- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp +++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp @@ -46,7 +46,6 @@ // From qquickfolderlistmodel.h const int FileNameRole = Qt::UserRole+1; -const int FilePathRole = Qt::UserRole+2; enum SortField { Unsorted, Name, Time, Size, Type }; class tst_qquickfolderlistmodel : public QQmlDataTest -- cgit v1.2.3 From 4a3f6e58b591f2fe2204f7cbc1efc8abb0aade74 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 8 Dec 2014 10:25:09 +0100 Subject: QML: fix warning in tests Remove unused function that wouldn't be emitted anyway. Change-Id: I623d5d44bca9a1358cf9e66ff557992aba9ae451 Reviewed-by: Simon Hausmann --- .../qquickaccessible/tst_qquickaccessible.cpp | 23 ---------------------- 1 file changed, 23 deletions(-) diff --git a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp index f6d5d16605..e0ea57056a 100644 --- a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp +++ b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp @@ -59,29 +59,6 @@ } \ } while (0) -static int verifyHierarchy(QAccessibleInterface *iface) -{ - int errorAt = 0; - static int treelevel = 0; // for error diagnostics - QAccessibleInterface *if2; - ++treelevel; - int middle = iface->childCount()/2 + 1; - for (int i = 0; i < iface->childCount() && !errorAt; ++i) { - if2 = iface->child(i); - EXPECT(if2 != 0); - // navigate Ancestor... - QAccessibleInterface *parent = if2->parent(); - EXPECT(iface->object() == parent->object()); - - // verify children... - if (!errorAt) - errorAt = verifyHierarchy(if2); - } - - --treelevel; - return errorAt; -} - //TESTED_FILES= -- cgit v1.2.3