From 0bba8d7411d0b1f1b547f9ac960e7d84769c7154 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 13 Jan 2015 16:59:22 +0100 Subject: Fix failing assertion in debug builds for JS that calls constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For true() we generate IR that looks like this: temp = true result = call temp() and therefore the move at isel time has IR::Call as source and a temp as base for the call. However constant propagation in the optimizer transforms this to result = call true() and that's a case we didn't handle in the IR visitor. Since we have Runtime::callValue we can however handle this case as well and the run-time will consequently produce the expected run-time error. Change-Id: Ia94a8116388e66f9f339913307f68e33a5c18a19 Task-number: QTBUG-43819 Reviewed-by: Robin Burchell Reviewed-by: Jan Kundrát Reviewed-by: Erik Verbruggen --- src/qml/compiler/qv4isel_p.cpp | 2 +- src/qml/jsruntime/qv4runtime.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qv4isel_p.cpp b/src/qml/compiler/qv4isel_p.cpp index e419084238..4bb866616d 100644 --- a/src/qml/compiler/qv4isel_p.cpp +++ b/src/qml/compiler/qv4isel_p.cpp @@ -182,7 +182,7 @@ void IRDecoder::visitMove(IR::Move *s) } else if (Subscript *ss = c->base->asSubscript()) { callSubscript(ss->base, ss->index, c->args, s->target); return; - } else if (c->base->asTemp() || c->base->asArgLocal()) { + } else if (c->base->asTemp() || c->base->asArgLocal() || c->base->asConst()) { callValue(c->base, c->args, s->target); return; } diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index f72f25bd58..b019d4db14 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -961,7 +961,7 @@ ReturnedValue Runtime::callElement(ExecutionContext *context, const ValueRef ind ReturnedValue Runtime::callValue(ExecutionContext *context, const ValueRef func, CallData *callData) { if (!func->isObject()) - return context->throwTypeError(); + return context->throwTypeError(QStringLiteral("%1 is not a function").arg(func->toQStringNoThrow())); return func->objectValue()->call(callData); } -- cgit v1.2.3 From 0a6323c2de23bd7a23e44ff3a534b06f7be994c6 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 16 Jan 2015 11:01:58 +0100 Subject: Scale mipmapped npot images when not supported Task-number: QTBUG-43847 Task-number: QTBUG-40789 Change-Id: Iceacaa49bafffb31752a9fb26c896df570153fec Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/util/qsgtexture.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index fc5050014e..bfc9212138 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -75,13 +76,11 @@ static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty(); QT_BEGIN_NAMESPACE -#ifndef QT_NO_DEBUG inline static bool isPowerOfTwo(int x) { // Assumption: x >= 1 return x == (x & -x); } -#endif QSGTexturePrivate::QSGTexturePrivate() : wrapChanged(false) @@ -686,6 +685,16 @@ void QSGPlainTexture::bind() m_texture_size = tmp.size(); } + // Scale to a power of two size if mipmapping is requested and the + // texture is npot and npot textures are not properly supported. + if (mipmapFiltering() != QSGTexture::None + && (!isPowerOfTwo(m_texture_size.width()) || !isPowerOfTwo(m_texture_size.height())) + && !funcs->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures)) { + tmp = tmp.scaled(qNextPowerOfTwo(m_texture_size.width()), qNextPowerOfTwo(m_texture_size.height()), + Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + m_texture_size = tmp.size(); + } + if (tmp.width() * 4 != tmp.bytesPerLine()) tmp = tmp.copy(); -- cgit v1.2.3 From c391991b59a5ae289d09540a6666a2b46c204677 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Mon, 8 Dec 2014 17:58:50 +0100 Subject: Fix and improve links to Component::completed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I39771b861c529550c59f142c054b108f7a8bc7ff Reviewed-by: Topi Reiniö --- .../doc/src/qmllanguageref/syntax/objectattributes.qdoc | 14 +++++++------- src/qml/doc/src/qmllanguageref/syntax/signals.qdoc | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index dd42e251c2..cd37e8a6a2 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -893,11 +893,11 @@ property in question is \c isCurrentItem, hence the attached property is referred to as \c ListView.isCurrentItem. An attached signal handler is referred to in the same way. For example, the -\c Component.isCompleted attached signal handler is commonly used to execute -some JavaScript code when a component's creation process has been completed. -In the example below, once the \l ListModel has been fully created, its -\c Component.onCompleted signal handler will automatically be invoked to -populate the model: +\l{Component::completed}{Component.onCompleted} attached signal handler is +commonly used to execute some JavaScript code when a component's creation +process has been completed. In the example below, once the \l ListModel has +been fully created, its \c Component.onCompleted signal handler will +automatically be invoked to populate the model: \qml import QtQuick 2.0 @@ -916,8 +916,8 @@ ListView { \endqml Since the name of the \e {attaching type} is \c Component and that type has a -\c completed signal, the attached signal handler is referred to as -\c Component.isCompleted. +\l{Component::completed}{completed} signal, the attached signal handler is +referred to as \c Component.onCompleted. \section3 A Note About Accessing Attached Properties and Signal Handlers diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc index 3e830c1f3c..16d1ac32c4 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc @@ -144,7 +144,9 @@ Rectangle { An \l {Attached Properties and Attached Signal Handlers}{attached signal handler} is a signal handler that receives a signal from an \e {attaching type} rather than the object within which the handler is declared. -For example, \c \l {Component::isCompleted}{Component.isCompleted} is an attached signal handler. This handler is often used to execute some JavaScript code when its creation process has been completed, as in the example below: +For example, \l{Component::completed}{Component.onCompleted} is an attached +signal handler. This handler is often used to execute some JavaScript code when +its creation process has been completed, as in the example below: \qml import QtQuick 2.0 -- cgit v1.2.3 From aa7716b2ddc0f6d10d34a886f123c00c47e4f167 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 14 Jan 2015 14:54:51 +0100 Subject: Doc: Rename section title 'Text' to prevent incorrect linking Other modules use 'Text' as a link target, with the intention to link to the Text QML type. This change renames a section title on the "What's New" page. This way, links to 'Text' will always be resolved to the correct page. Change-Id: I69738d91cb3c01db794c38331a448c9f954fbd2b Reviewed-by: Martin Smith Reviewed-by: Leena Miettinen --- src/quick/doc/src/whatsnew.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc index ca2a2156d8..017a534b4c 100644 --- a/src/quick/doc/src/whatsnew.qdoc +++ b/src/quick/doc/src/whatsnew.qdoc @@ -193,7 +193,7 @@ relative to its start. \endlist -\section2 Text +\section2 Text Rendering and Input \list \li Changes common to \l Text, TextEdit and TextInput: -- cgit v1.2.3 From d14566a5e284d7ff3569c2a505f0a0fc6c2936e1 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 16 Jan 2015 11:13:10 +0100 Subject: Fix grammar in Keyboard Focus documentation. Change-Id: Ia15e5fbe9b241f99bd0c43b427e20273fa35ac67 Reviewed-by: Venugopal Shivashankar --- src/quick/doc/src/concepts/input/focus.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/doc/src/concepts/input/focus.qdoc b/src/quick/doc/src/concepts/input/focus.qdoc index f75f3d2bad..6a7d41dbab 100644 --- a/src/quick/doc/src/concepts/input/focus.qdoc +++ b/src/quick/doc/src/concepts/input/focus.qdoc @@ -138,7 +138,7 @@ similar to when there are no focus scopes. \li When a focus scope receives active focus, the contained type with \c focus set (if any) also gets the active focus. If this type is also a \l FocusScope, the proxying behavior continues. Both the -focus scope and the sub-focused item will have \c activeFocus property set. +focus scope and the sub-focused item will have the \c activeFocus property set. \endlist Note that, since the FocusScope type is not a visual type, the properties -- cgit v1.2.3 From f200469fcb197f07abd8e586529407d3a667a86e Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 19 Jan 2015 15:21:07 +0100 Subject: Doc: link issues qtdeclarative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added modules to depends stat. qtquick.qdocconf Task-number:QTBUG-43810 Change-Id: If6010a382e2c9011b7599f25eb31ba9c9c3b3eb0 Reviewed-by: Topi Reiniö --- src/qml/doc/qtqml.qdocconf | 2 +- src/quick/doc/qtquick.qdocconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf index 7806a1103f..7738cb3eef 100644 --- a/src/qml/doc/qtqml.qdocconf +++ b/src/qml/doc/qtqml.qdocconf @@ -33,7 +33,7 @@ qhp.QtQml.subprojects.qmltypes.sortPages = true tagfile = ../../../doc/qtqml/qtqml.tags -depends += qtcore qtxmlpatterns qtgui qtquick qtdoc qtlinguist +depends += qtcore qtxmlpatterns qtgui qtquick qtdoc qtlinguist qmake qtscript headerdirs += .. \ ../../imports/models diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf index 41fe42777b..afe1b9708f 100644 --- a/src/quick/doc/qtquick.qdocconf +++ b/src/quick/doc/qtquick.qdocconf @@ -33,7 +33,7 @@ qhp.QtQuick.subprojects.examples.selectors = fake:example tagfile = ../../../doc/qtquick/qtquick.tags -depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtquicklayouts qtdoc qtquickdialogs qtsensors qtwidgets +depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtquicklayouts qtdoc qtquickdialogs qtsensors qtwidgets qmake qtmultimedia qtgraphicaleffects headerdirs += ..\ ../../quickwidgets -- cgit v1.2.3 From 3043ae3a2c1c3028b3143d8f06efdd07c1bbef38 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 20 Jan 2015 20:05:41 +0100 Subject: Fix docs for QQuickWindow::RenderStage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I55265f16de153289b3e6f80d510d428f48492bbb Reviewed-by: Topi Reiniö --- src/quick/items/qquickwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 359f68a114..eaeb70b299 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -3940,14 +3940,14 @@ void QQuickWindow::resetOpenGLState() */ /*! - \enum QQuickWindow::RenderJobSchedule + \enum QQuickWindow::RenderStage \since 5.4 - \value ScheduleBeforeSynchronizing Before synchronization. - \value ScheduleAfterSynchronizing After synchronization. - \value ScheduleBeforeRendering Before rendering. - \value ScheduleAfterRendering After rendering. - \value ScheduleAfterSwap After the frame is swapped. + \value BeforeSynchronizingStage Before synchronization. + \value AfterSynchronizingStage After synchronization. + \value BeforeRenderingStage Before rendering. + \value AfterRenderingStage After rendering. + \value AfterSwapStage After the frame is swapped. \sa {Scene Graph and Rendering} */ -- cgit v1.2.3 From 6b3ac8e2e0944fb6025371c2ff37db350fef69fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 21 Jan 2015 16:02:17 +0200 Subject: Fix usage of pow to C99 standard compliance Change-Id: I37c25b848dd3f53afff360d81a3a685cbd8e5d26 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4globalobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 9a9de8bb41..77bc9f579c 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -502,7 +502,7 @@ ReturnedValue GlobalFunctions::method_parseInt(CallContext *ctx) } if (overflow) { - double result = (double) v_overflow * pow(R, overflow_digit_count); + double result = (double) v_overflow * pow(static_cast(R), static_cast(overflow_digit_count)); result += v; return Encode(sign * result); } else { -- cgit v1.2.3 From 4d76e4fd35e90356b3115fb64df853849f4ffcbc Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 21 Jan 2015 14:32:08 +0100 Subject: Image: Fix that HiDPI image was not found with QRC alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using images in QRC and giving the 1x and 2x image files respective aliases but without any file extension (for example 'myimage' and 'myimage@2x'), then Image would fail to find the 2x variant. Task-number: QTBUG-44049 Change-Id: I20d0cb2eb48b909775b0ba737b850bc1b6697b35 Reviewed-by: Alan Alpert Reviewed-by: Morten Johan Sørvig --- src/quick/items/qquickimagebase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index a4c4af4e45..bdd0ef0ce4 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -310,7 +310,7 @@ static QString image2xPath(const QString &path) { const int dotIndex = path.lastIndexOf(QLatin1Char('.')); if (dotIndex == -1) - return path; + return path + QLatin1String("@2x"); if (path.contains(QLatin1String("@2x."))) return path; -- cgit v1.2.3 From c883603035dc0329c2d2ced12b24124fbb90f3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 21 Jan 2015 12:14:18 +0200 Subject: Use sysconf function for getting memory page size Function getpagesize is deprecated and should not be used. Change-Id: I4d4827662b2e8cb1e668129491a11d58f6722a1d Reviewed-by: Simon Hausmann --- src/3rdparty/masm/wtf/PageBlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty/masm/wtf/PageBlock.cpp b/src/3rdparty/masm/wtf/PageBlock.cpp index a6f5585925..e715ed262a 100644 --- a/src/3rdparty/masm/wtf/PageBlock.cpp +++ b/src/3rdparty/masm/wtf/PageBlock.cpp @@ -44,7 +44,7 @@ static size_t s_pageMask; inline size_t systemPageSize() { - return getpagesize(); + return ::sysconf(_SC_PAGESIZE); } #elif OS(WINDOWS) -- cgit v1.2.3 From 47c089d15f79cd678e0c9de5c7fb5b5e2488a9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 21 Jan 2015 12:35:38 +0200 Subject: V4: include alloca private header as alloca is used unconditionally. Change-Id: Ic94a7ec3980ca9e2629620ef83c93b179d75162b Reviewed-by: Simon Hausmann --- src/qml/jit/qv4regalloc.cpp | 1 + src/qml/jsruntime/qv4stringobject.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp index e69522404d..f9f494c561 100644 --- a/src/qml/jit/qv4regalloc.cpp +++ b/src/qml/jit/qv4regalloc.cpp @@ -32,6 +32,7 @@ ****************************************************************************/ #include "qv4regalloc_p.h" +#include "qv4alloca_p.h" #include #include diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index 397a6efdf8..8bf9a096c5 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -37,6 +37,7 @@ #include "qv4objectproto_p.h" #include "qv4mm_p.h" #include "qv4scopedvalue_p.h" +#include "qv4alloca_p.h" #include #include #include -- cgit v1.2.3 From 15ffff51b5cc92eb875785bbd16b6385638fe5dd Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 19 Jan 2015 18:06:07 +0100 Subject: Avoid sRGB usage when targeting an incapable FBO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Native text rendering results in very different output on OS X with QQuickWidget/QOpenGLWidget. When targeting an FBO, enabling sRGB is futile if the FBO was not created with the correct format. In this case we need to disable the usage of sRGB. Task-number: QTBUG-42861 Change-Id: I887482e70be2cbfba40d6758546128d03b36def1 Reviewed-by: Eike Ziller Reviewed-by: Morten Johan Sørvig Reviewed-by: Jørgen Lind --- src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 5cca474ea1..9263d5676f 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -53,6 +53,10 @@ QT_BEGIN_NAMESPACE #define GL_FRAMEBUFFER_SRGB 0x8DB9 #endif +#ifndef GL_FRAMEBUFFER_SRGB_CAPABLE +#define GL_FRAMEBUFFER_SRGB_CAPABLE 0x8DBA +#endif + static inline QVector4D qsg_premultiply(const QVector4D &c, float globalOpacity) { float o = c.w() * globalOpacity; @@ -199,7 +203,11 @@ void QSG24BitTextMaskShader::initialize() if (QOpenGLContext::currentContext()->hasExtension(QByteArrayLiteral("GL_ARB_framebuffer_sRGB")) && m_glyphFormat == QFontEngine::Format_A32 && qAbs(fontSmoothingGamma() - 2.2) < 0.25) { - m_useSRGB = true; + QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); + GLint srgbCapable = 0; + funcs->glGetIntegerv(GL_FRAMEBUFFER_SRGB_CAPABLE, &srgbCapable); + if (srgbCapable) + m_useSRGB = true; } } -- cgit v1.2.3 From 93affd9ff660456bde2d380788ea8ebfabb0f1c3 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 26 Jan 2015 15:53:15 +0100 Subject: Canvas: don't crash when getContext("2d") is called on destruction. We'd assume that a Window existed when that's not always the case. For example: import QtQuick 2.4 import QtQuick.Window 2.2 Window { Loader { sourceComponent: Canvas { Component.onDestruction: getContext("2d") } Component.onCompleted: active = false } } Change-Id: I5f30876e21ced5658adfa3bac494fd4196e0a7e3 Task-number: QTBUG-42222 Reviewed-by: Ulf Hermann --- src/quick/items/context2d/qquickcanvasitem.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index c31b7726c4..4b28517701 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -1124,6 +1124,9 @@ bool QQuickCanvasItem::createContext(const QString &contextType) { Q_D(QQuickCanvasItem); + if (!window()) + return false; + if (contextType == QLatin1String("2d")) { if (d->contextType.compare(QLatin1String("2d"), Qt::CaseInsensitive) != 0) { d->contextType = QLatin1String("2d"); -- cgit v1.2.3 From dd017ee946aaa7f968aa844a54b394f88109c150 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Tue, 27 Jan 2015 13:29:49 +0100 Subject: Doc fix: QHistoryState is registered in QML as HistoryState The documentation enum values should reflect that. Task-number: QTBUG-44088 Change-Id: I0042da252eac10301fff4289402f158a7b0d0ff6 Reviewed-by: Simon Hausmann --- src/imports/statemachine/state.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/imports/statemachine/state.cpp b/src/imports/statemachine/state.cpp index 56ecd015f5..bcc14b5912 100644 --- a/src/imports/statemachine/state.cpp +++ b/src/imports/statemachine/state.cpp @@ -221,15 +221,15 @@ QQmlListProperty State::children() \brief The type of history that this history state records. - The default value of this property is QHistoryState.ShallowHistory. + The default value of this property is HistoryState.ShallowHistory. - This enum specifies the type of history that a QHistoryState records. + This enum specifies the type of history that a HistoryState records. \list - \li QHistoryState.ShallowHistory Only the immediate child states of the + \li HistoryState.ShallowHistory Only the immediate child states of the parent state are recorded. In this case, a transition with the history state as its target will end up in the immediate child state that the parent was in the last time it was exited. This is the default. - \li QHistoryState.DeepHistory Nested states are recorded. In this case + \li HistoryState.DeepHistory Nested states are recorded. In this case a transition with the history state as its target will end up in the most deeply nested descendant state the parent was in the last time it was exited. -- cgit v1.2.3 From fea8c9026def98748f700e33e9fb41249be2b3f2 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 27 Jan 2015 18:09:56 +0100 Subject: Ensure that Canvas has the correct size with complex bindings. When a Canvas is a child of an item with certain width and height values (as described in the bug report), it won't paint correctly. For example, the order of events might occur like so: 1. Canvas width set to 1 2. Canvas height set to 1 3. Canvas width set to 32, which causes the height to also be set to 32 Every size change causes QQuickCanvasItem::geometryChanged() to be called, but the third event above causes it to be called recursively, such that the most nested call results in the size being 32x32, but then the execution returns to the first call and 32x1 is used instead, overwriting the correct size. We fix this by setting the new canvas size to width() and height(), ignoring the recursion and instead using the latest size of the item. Change-Id: Iebbcbfaa3217319b32b97f6b68f7a8af197a0e89 Task-number: QTBUG-42878 Reviewed-by: Gunnar Sletta --- src/quick/items/context2d/qquickcanvasitem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 4b28517701..b39c4e49f8 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -592,7 +592,9 @@ void QQuickCanvasItem::geometryChanged(const QRectF &newGeometry, const QRectF & QQuickItem::geometryChanged(newGeometry, oldGeometry); - QSizeF newSize = newGeometry.size(); + // Due to indirect recursion, newGeometry may be outdated + // after this call, so we use width and height instead. + QSizeF newSize = QSizeF(width(), height()); if (!d->hasCanvasSize && d->canvasSize != newSize) { d->canvasSize = newSize; emit canvasSizeChanged(); -- cgit v1.2.3 From cf6e97119df5bf17b4a952b257d05d43b7d6ca26 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 21 Jan 2015 09:10:01 +0000 Subject: Don't crash on FreeBSD when computing stack limits On FreeBSD pthread_attr_t is a pointer and is dereferenced when calling pthread_attr_get_np() so if we don't initialize it will probably crash. This is not a problem on glibc systems since there pthread_attr_t is an opaque union an doesn't need to be allocated using malloc(). Change-Id: I227685ddf9981974ade08aee8917f7262c301787 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 74b262e86d..5bba745ae2 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -112,7 +112,8 @@ quintptr getStackLimit() void* stackBottom = 0; pthread_attr_t attr; #if HAVE(PTHREAD_NP_H) && OS(FREEBSD) - if (pthread_attr_get_np(pthread_self(), &attr) == 0) { + // on FreeBSD pthread_attr_init() must be called otherwise getting the attrs crashes + if (pthread_attr_init(&attr) == 0 && pthread_attr_get_np(pthread_self(), &attr) == 0) { #else if (pthread_getattr_np(pthread_self(), &attr) == 0) { #endif -- cgit v1.2.3 From 9abd557e2c718b02fc0a14999150e50508ff5f9a Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 26 Jan 2015 15:40:29 +0100 Subject: QQuickTextItem: fix crash on polishing The "d->extra" pointer is lazily allocated, hence we must check if it's valid before dereferencing it. Task-number: QTBUG-44128 Change-Id: Id69c91e889193b0e9b73ed178c0ff3b13003227f Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: J-P Nurmi --- src/quick/items/qquicktext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index be86b2976b..51ae5ee93c 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -2737,7 +2737,7 @@ void QQuickText::invalidateFontCaches() { Q_D(QQuickText); - if (d->richText && d->extra->doc != 0) { + if (d->richText && d->extra.isAllocated() && 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) -- cgit v1.2.3 From 7cf59462ce19dd9b23d523090f9f8eea37a15cc8 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 29 Jan 2015 14:15:35 +0100 Subject: Doc: fix Qt.platform.os since -tag Change-Id: I623ae8818d6d8f10faec2f823c4d27a37d8fecda Reviewed-by: Caroline Chao --- src/qml/qml/qqmlengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 04a2f9cadd..3b82fa15c0 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -368,7 +368,7 @@ The following functions are also on the Qt object. /*! \qmlproperty object Qt::platform - \since 4.8 + \since 5.1 The \c platform object provides info about the underlying platform. -- cgit v1.2.3 From e8bc9f7fbcbb88d4cfa5288b14843cc23a51d70a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 29 Jan 2015 14:14:54 +0100 Subject: Doc: add missing "winrt" & "winphone" to Qt.platform.os Change-Id: Idc252cc0303ffd7e8259cd9bf19a05a643657600 Reviewed-by: Caroline Chao Reviewed-by: Karim Pinter --- src/qml/qml/qqmlengine.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 3b82fa15c0..610952440e 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -392,6 +392,8 @@ The following functions are also on the Qt object. \li \c "unix" - Other Unix-based OS \li \c "windows" - Windows \li \c "wince" - Windows CE + \li \c "winrt" - Windows RT + \li \c "winphone" - Windows Phone \endlist \endtable */ -- cgit v1.2.3 From 40ac5e74becfdfd60626cb78d2ed56d9871a33e8 Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Wed, 19 Nov 2014 15:25:02 +0200 Subject: Fix vertical positioning of the first image in Text Task-number: QTBUG-38528 Change-Id: Ie16000cf9ba20598da51683751a8fb62798a1322 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> --- src/quick/items/qquicktextnodeengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index 67ff79d20f..e99c5c158b 100644 --- a/src/quick/items/qquicktextnodeengine.cpp +++ b/src/quick/items/qquicktextnodeengine.cpp @@ -405,7 +405,7 @@ void QQuickTextNodeEngine::addImage(const QRectF &rect, const QImage &image, qre QRectF searchRect = rect; if (layoutPosition == QTextFrameFormat::InFlow) { if (m_currentLineTree.isEmpty()) { - searchRect.moveTopLeft(m_position + m_currentLine.position()); + searchRect.moveTopLeft(m_position + m_currentLine.position() + QPointF(0,1)); } else { const BinaryTreeNode *lastNode = m_currentLineTree.data() + m_currentLineTree.size() - 1; if (lastNode->glyphRun.isRightToLeft()) { -- cgit v1.2.3 From 9230cb14ba383e0e2633725ade6a64f8b20bac41 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 7 Jan 2015 23:04:36 +0100 Subject: Doc: Fixed a broken link about sprite sheet script Change-Id: Ia574bee49f9c509c83bf9818442fbd314a0259b7 Reviewed-by: Liang Qi Reviewed-by: Martin Smith --- src/quick/doc/src/concepts/effects/sprites.qdoc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/quick/doc/src/concepts/effects/sprites.qdoc b/src/quick/doc/src/concepts/effects/sprites.qdoc index 805a423002..31a5502128 100644 --- a/src/quick/doc/src/concepts/effects/sprites.qdoc +++ b/src/quick/doc/src/concepts/effects/sprites.qdoc @@ -144,14 +144,12 @@ to some graphics memory limitations. Because it requires all the sprites for a s texture, attempting to load many different animations can run into texture memory limits on embedded devices. In these situations, a warning will be output to the console containing the maximum texture size. -There are several software tools to help turn images into sprite sheets, here are some examples: -Photoshop plugin: -http://www.personal.psu.edu/zez1/blogs/my_blog/2011/05/scripts-4-photoshop-file-sequence-to-layers-to-sprite-sheet.html -Gimp plugin: -http://registry.gimp.org/node/20943 -Cmd-line tool: -http://www.imagemagick.org/script/montage.php - +There are several tools to help turn a set of images into sprite sheets, here are some examples: +\list + \li Photoshop plugin: \l http://www.johnwordsworth.com/projects/photoshop-sprite-sheet-generator-script + \li Gimp plugin: \l http://registry.gimp.org/node/20943 + \li Cmd-line tool: \l http://www.imagemagick.org/script/montage.php +\endlist \section2 QML Types Using the Sprite Engine -- cgit v1.2.3 From 5df747fc5300f9c7e1da0fb86bab68209c921c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= Date: Wed, 28 Jan 2015 19:09:04 +0100 Subject: Fix possible crash when removing items from QQmlDelegateModel When iterating over the cache in QQmlDelegateModel::_q_itemsRemoved(), removing of some of the items can trigger layout change in the view, which might in turn remove a QQmlDelegateModelItem from the cache, causing us to dereference an already deleted pointer. To prevent crash, we always check whether the item is still valid in the original cache and skip it if it has been removed in the meanwhile. Task-number: QTBUG-34351 Change-Id: Ib91a0544e11dbd7bf6d82fa4dc4400cac9d0b5f7 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> --- src/qml/types/qqmldelegatemodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 8b65373133..79f150ce05 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -1335,6 +1335,11 @@ void QQmlDelegateModel::_q_itemsRemoved(int index, int count) const QList cache = d->m_cache; for (int i = 0, c = cache.count(); i < c; ++i) { QQmlDelegateModelItem *item = cache.at(i); + // layout change triggered by removal of a previous item might have + // already invalidated this item in d->m_cache and deleted it + if (!d->m_cache.contains(item)) + continue; + if (item->modelIndex() >= index + count) item->setModelIndex(item->modelIndex() - count); else if (item->modelIndex() >= index) -- cgit v1.2.3 From 81b876b7177cf0d55b7c009342e501bfa900175c Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Fri, 23 Jan 2015 14:42:33 -0800 Subject: qquicktest: Wait for the view to finish loading Tests can be skipped if the view is still loading by the time we get to the end of the loop. There is a case where the window is active but the QML hasn't been loaded. Change-Id: I4e8346ee547653810458d042925d673748c1fec8 Reviewed-by: Caroline Chao Reviewed-by: Friedemann Kleint Reviewed-by: J-P Nurmi --- src/qmltest/quicktest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index bef20c6464..0c8bfab1fa 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -362,6 +362,10 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD } view->show(); view->requestActivate(); + + while (view->status() == QQuickView::Loading) + QTest::qWait(10); + QTest::qWaitForWindowActive(view); if (view->isExposed()) QTestRootObject::instance()->setWindowShown(true); -- cgit v1.2.3 From 3b2e59130bf264ec63bf51b2049989f697d91ca1 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 2 Feb 2015 11:23:31 -0600 Subject: Fix Text wrapping when growing from 0 width. The fix for QTBUG-30896 caused a regression in the test case. Now check both width and implicit width validity before resetting widthExceeded. Change-Id: I4aba2aad299746906cfe20e288fa60cfe2acc64f Reviewed-by: Andrew den Exter --- src/quick/items/qquicktext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index be86b2976b..bff38879cf 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -955,7 +955,7 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline) // If the horizontal alignment is not left and the width was not valid we need to relayout // now that we know the maximum line width. - if (!implicitWidthValid && unwrappedLineCount > 1 && q->effectiveHAlign() != QQuickText::AlignLeft) { + if (!q->widthValid() && !implicitWidthValid && unwrappedLineCount > 1 && q->effectiveHAlign() != QQuickText::AlignLeft) { widthExceeded = false; heightExceeded = false; continue; -- cgit v1.2.3 From 9663b7b5c1a051b46a731b0587a4623a2ab21b0d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 3 Feb 2015 17:26:08 +0100 Subject: TextInput: update the baseline offset when vertical alignment changes Change-Id: I2153e879c7ad8b770d5ca47dac68f994bb171b2d Reviewed-by: Alan Alpert --- src/quick/items/qquicktextinput.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index a9c60273d2..c45f3dc40c 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -578,6 +578,7 @@ void QQuickTextInput::setVAlign(QQuickTextInput::VAlignment alignment) emit verticalAlignmentChanged(d->vAlign); if (isComponentComplete()) { updateCursorRectangle(); + d->updateBaselineOffset(); } } -- cgit v1.2.3 From 566b23df8c31b50fc514a069564d23121d0f4ef9 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 2 Feb 2015 12:43:49 +0100 Subject: Doc: link issues qtdeclarative Task-number: QTBUG-43810 Change-Id: I154ffa83512435c3e455937a3f81931a45d9e368 Reviewed-by: Martin Smith --- src/qml/doc/qtqml.qdocconf | 2 +- .../src/qmllanguageref/typesystem/basictypes.qdoc | 5 ----- src/qml/doc/src/whatsnew.qdoc | 1 - src/qml/types/qquickpackage.cpp | 2 +- src/quick/doc/src/dynamicview-tutorial.qdoc | 20 ++++++++++---------- src/quick/doc/src/whatsnew.qdoc | 4 ++-- src/quick/items/qquickaccessibleattached.cpp | 4 ++-- src/quick/items/qquickdrag.cpp | 4 ++-- src/quick/items/qquickitem.cpp | 16 +++++++--------- src/quick/items/qquickwindow.cpp | 6 +++--- src/quick/util/qquickfontmetrics.cpp | 2 +- src/quick/util/qquicktextmetrics.cpp | 4 ++-- 12 files changed, 31 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf index 7738cb3eef..5729a60ea3 100644 --- a/src/qml/doc/qtqml.qdocconf +++ b/src/qml/doc/qtqml.qdocconf @@ -33,7 +33,7 @@ qhp.QtQml.subprojects.qmltypes.sortPages = true tagfile = ../../../doc/qtqml/qtqml.tags -depends += qtcore qtxmlpatterns qtgui qtquick qtdoc qtlinguist qmake qtscript +depends += qtcore qtxmlpatterns qtgui qtquick qtdoc qtlinguist qmake qtscript qtwidgets headerdirs += .. \ ../../imports/models diff --git a/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc b/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc index 1a154e5d5a..93a36e80fc 100644 --- a/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc +++ b/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc @@ -499,9 +499,6 @@ property is only invoked when the property is reassigned to a different object v may also explicitly preserve the scarce resource by calling the "preserve" method on the \c var property from within JavaScript. - For more information regarding the usage of a scarce resource, please - see \l{Scarce Resources in JavaScript}. - This basic type is provided by the QML language. */ @@ -543,8 +540,6 @@ property is only invoked when the property is reassigned to a different object v "destroy" method on the \c variant property from within JavaScript. They may also explicitly preserve the scarce resource by calling the "preserve" method on the \c variant property from within JavaScript. - For more information on the usage of a scarce resource, please - see \l{Scarce Resources in JavaScript}. \section1 Storing Arrays and Objects diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc index 10e7108207..11b899e926 100644 --- a/src/qml/doc/src/whatsnew.qdoc +++ b/src/qml/doc/src/whatsnew.qdoc @@ -95,7 +95,6 @@ has now been replaced by the new \l {Qt QML} and \l {Qt Quick} modules. See the \li New \l var property type. This is a general-purpose property type which obsoletes the \l variant type. Properties of the \l var type may hold JavaScript references. \li QML properties of type \l var and \l variant can now hold pixmaps. - See \l {Scarce Resources in JavaScript} for more information. \li Value type improvements: \list \li QML now supports defining properties of value type basic types within QML documents. Supported types include diff --git a/src/qml/types/qquickpackage.cpp b/src/qml/types/qquickpackage.cpp index fc64b8f136..ad2618d1c1 100644 --- a/src/qml/types/qquickpackage.cpp +++ b/src/qml/types/qquickpackage.cpp @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE \snippet package/Delegate.qml 0 These named items are used as the delegates by the two views who - reference the special \l{VisualDataModel::parts} property to select + reference the special \l{DelegateModel::parts} property to select a model which provides the chosen delegate. \snippet package/view.qml 0 diff --git a/src/quick/doc/src/dynamicview-tutorial.qdoc b/src/quick/doc/src/dynamicview-tutorial.qdoc index 619f0abd4b..dd5e1ce344 100644 --- a/src/quick/doc/src/dynamicview-tutorial.qdoc +++ b/src/quick/doc/src/dynamicview-tutorial.qdoc @@ -165,14 +165,14 @@ to the index of the item it was dragged over. To move the items within the view we use a DelegateModel. The DelegateModel type is used by the view types to instantiate delegate items from model data and when constructed explicitly can be used to filter and re-order the model items provided to ListView. The -\l {QtQuick::DelegateModel::items}{items} property of DelegateModel provides access to the +\l [QML]{DelegateModel::}{items} property of DelegateModel provides access to the view's items and allows us to change the visible order without modifying the source model. To -determine the current visible index of the items we use \l {QtQuick::DelegateModel::itemsIndex} +determine the current visible index of the items we use \l {DelegateModel::}{itemsIndex} {itemsIndex} property on the DelegateModel attached property of the delegate item. -To utilize a DelegateModel with a ListView we bind it to the \l {QtQuick::ListView::model}{model} -property of the view and bind the \l {QtQuick::DelegateModel::model}{model} and -\l {QtQuick::DelegateModel::delegate}{delegate} to the DelegateModel. +To utilize a DelegateModel with a ListView we bind it to the \l {ListView::}{model} +property of the view and bind the \l {DelegateModel::}{model} and +\l {DelegateModel::}{delegate} to the DelegateModel. \snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 4 @@ -194,7 +194,7 @@ like this: \section2 Walkthrough Items in a DelegateModel are filtered into groups represented by the DelegateModelGroup type, -normally all items in the model belong to a default \l {QtQuick::DelegateModel::items}{items} +normally all items in the model belong to a default \l {DelegateModel::}{items} group but this default can be changed with the includeByDefault property. To implement our sorting we want items to first be added to an unsorted group from where we can transfer them to a sorted position in the items group. To do that we clear includeByDefault on the items group and set it on @@ -208,7 +208,7 @@ item and then transfer the item to the items group before moving it to the pre-d repeat until the unsorted group is empty. To find the insert position for an item we request a handle for the item from the unsorted group -with the \l {QtQuick::DelegateModel::get} {get} function. Through the model property on this +with the \l {DelegateModel::}{get} function. Through the model property on this handle we can access the same model data that is available in a delegate instance of that item and compare against other items to determine relative position. @@ -220,7 +220,7 @@ of the list. In this example it can be one of the following: \snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 4 A sort is triggered whenever new items are added to the unsorted DelegateModel which we are -notified of by the \l {QtQuick::DelegateModelGroup::onChanged}{onChanged} handler. If no sort +notified of by the \l {DelegateModelGroup} \c onChanged handler. If no sort function is currently selected we simply transfer all items from the unsorted group to the items group, otherwise we call sort with the selected sort function. @@ -228,8 +228,8 @@ group, otherwise we call sort with the selected sort function. Finally when the selected sort order changes we can trigger a full re-sort of the list by moving all items from the items group to the unsorted group, which will trigger the -\l {QtQuick::DelegateModelGroup::onChanged}{onChanged} handler and transfer the items back to the -items group in correct order. Note that the \l {QtQuick::DelegateModelGroup::onChanged}{onChanged} +\l {DelegateModelGroup} \c onChanged handler and transfer the items back to the +items group in correct order. Note that the \l {DelegateModelGroup} \c onChanged handler will not be invoked recursively so there's no issue with it being invoked during a sort. \snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 6 diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc index 017a534b4c..c41ea562f0 100644 --- a/src/quick/doc/src/whatsnew.qdoc +++ b/src/quick/doc/src/whatsnew.qdoc @@ -312,8 +312,8 @@ the window loses focus. \li VisualDataModel: \list \li Now has features to filter the items to be displayed in a view. This is supported by the new - \l {VisualDataModel::}{groups}, \l {VisualDataModel::}{filterOnGroup}, \l {VisualDataModel::}{items} - and \l {VisualDataModel::}{persistedItems} properties. + \l {DelegateModel::}{groups}, \l {DelegateModel::}{filterOnGroup}, \l {DelegateModel::}{items} + and \l {DelegateModel::}{persistedItems} properties. \endlist \li Changes common to both ListView and GridView: \list diff --git a/src/quick/items/qquickaccessibleattached.cpp b/src/quick/items/qquickaccessibleattached.cpp index abb763c2eb..57b814964b 100644 --- a/src/quick/items/qquickaccessibleattached.cpp +++ b/src/quick/items/qquickaccessibleattached.cpp @@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE } \endqml The \l role is set to \c Button to indicate the type of control. - \l Accessible.name is the most important information and bound to the text on the button. + \l {Accessible::}{name} is the most important information and bound to the text on the button. The name is a short and consise description of the control and should reflect the visual label. In this case it is not clear what the button does with the name only, so \l description contains an explanation. @@ -123,7 +123,7 @@ QT_BEGIN_NAMESPACE \li All interactive elements \li \l focusable and \l focused \li All elements that the user can interact with should have focusable set to \c true and - set \l focus to \c true when they have the focus. This is important even for applications + set \c focus to \c true when they have the focus. This is important even for applications that run on touch-only devices since screen readers often implement a virtual focus that can be moved from item to item. \row diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index 5641c323ab..cff2f26092 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -516,8 +516,8 @@ void QQuickDragAttached::setProposedAction(Qt::DropAction action) \endlist When using \c Drag.Automatic you should also define \l mimeData and bind the - \l active property to the active property of \l MouseArea.drag. - */ + \l active property to the active property of MouseArea : \l {MouseArea::drag.active} +*/ QQuickDrag::DragType QQuickDragAttached::dragType() const { diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 2722f48ce9..6a00f80171 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -1756,11 +1756,9 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus) QQmlProperty(), or QMetaProperty::write() when you need to modify those properties from C++. This ensures that the QML engine knows about the property change. Otherwise, the engine won't be able to carry out your - requested animation. For example, if you call \l setPosition() directly, - any behavior that reacts to changes in the x or y properties will not take - effect, as you are bypassing Qt's meta-object system. Note that these - functions incur a slight performance penalty. For more details, see - \l {Accessing Members of a QML Object Type from C++}. + requested animation. + Note that these functions incur a slight performance penalty. For more + details, see \l {Accessing Members of a QML Object Type from C++}. \sa QQuickWindow, QQuickPaintedItem */ @@ -5059,7 +5057,7 @@ void QQuickItem::setZ(qreal v) \endqml \endtable - \sa transform, Rotation + \sa Transform, Rotation */ /*! \property QQuickItem::rotation @@ -5085,7 +5083,7 @@ void QQuickItem::setZ(qreal v) \endqml \endtable - \sa transform, Rotation + \sa Transform, Rotation */ qreal QQuickItem::rotation() const { @@ -5145,7 +5143,7 @@ void QQuickItem::setRotation(qreal r) \endqml \endtable - \sa transform, Scale + \sa Transform, Scale */ /*! \property QQuickItem::scale @@ -5184,7 +5182,7 @@ void QQuickItem::setRotation(qreal r) \endqml \endtable - \sa transform, Scale + \sa Transform, Scale */ qreal QQuickItem::scale() const { diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index eaeb70b299..129c07da1d 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -3008,7 +3008,7 @@ QOpenGLContext *QQuickWindow::openglContext() const (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() + \sa QQuickWindow::closing() */ /*! @@ -3032,7 +3032,7 @@ QOpenGLContext *QQuickWindow::openglContext() const This signal is emitted when the user tries to close the window. - This signal includes a \a close parameter. The \a close \l accepted + This signal includes a \a close parameter. The \c {close.accepted} property is true by default so that the window is allowed to close; but you 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. @@ -3894,7 +3894,7 @@ void QQuickWindow::resetOpenGLState() 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() + \sa showFullScreen(), showMaximized(), showNormal(), hide(), QQuickItem::flags() */ /*! diff --git a/src/quick/util/qquickfontmetrics.cpp b/src/quick/util/qquickfontmetrics.cpp index b65ad3f1ea..0cb2c29c53 100644 --- a/src/quick/util/qquickfontmetrics.cpp +++ b/src/quick/util/qquickfontmetrics.cpp @@ -277,7 +277,7 @@ qreal QQuickFontMetrics::lineWidth() const \l {QQuickTextMetrics::advanceWidth}{advanceWidth} property of \l {QQuickTextMetrics::advanceWidth}{TextMetrics}. - \sa {QFontMetricsF::width()}, height() + \sa {QFontMetricsF::width()}, {QFontMetricsF::height()} */ qreal QQuickFontMetrics::advanceWidth(const QString &text) const { diff --git a/src/quick/util/qquicktextmetrics.cpp b/src/quick/util/qquicktextmetrics.cpp index fc5b6f11c4..666546b4ae 100644 --- a/src/quick/util/qquicktextmetrics.cpp +++ b/src/quick/util/qquicktextmetrics.cpp @@ -131,7 +131,7 @@ void QQuickTextMetrics::setText(const QString &text) \li \c Qt::ElideRight - For example: "Hello..." \endlist - \sa elideWidth, elidedText + \sa elideWidth, QFontMetrics::elidedText */ Qt::TextElideMode QQuickTextMetrics::elide() const { @@ -153,7 +153,7 @@ void QQuickTextMetrics::setElide(Qt::TextElideMode elide) This property holds the largest width the text can have (in pixels) before eliding will occur. - \sa elide, elidedText + \sa elide, QFontMetrics::elidedText */ qreal QQuickTextMetrics::elideWidth() const { -- cgit v1.2.3 From 0b60867f80e207a9ccc27cc337116d1c6fc928bd Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 5 Feb 2015 12:00:00 +0100 Subject: Fix crash when QQuickWindow::updatePolish() deletes QQuickItems. When an item is deleted as a result of an updatePolish() call, it will be removed from the itemsToPolish set. However, updatePolish() internally works on a copy of the itemsToPolish set because changes to the set would invalidate its iterator. Because it is a copy will still contain the deleted item. Fix this by simplifying the algorithm to instead pick items one by one from the itemsToPolish set until it is empty. The recursion guard has been increased because we're not decrementing it for every single QQuickItem::updatePolish() call. Task-number: QTBUG-42913 Change-Id: If7ab7f7616b01daf4d3ed843f927c163dfb03843 Reviewed-by: Robin Burchell --- src/quick/items/qquickwindow.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 129c07da1d..f21a93b83c 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -249,20 +249,22 @@ void QQuickWindow::focusInEvent(QFocusEvent *ev) void QQuickWindowPrivate::polishItems() { - int maxPolishCycles = 100000; - - while (!itemsToPolish.isEmpty() && --maxPolishCycles > 0) { - QSet itms = itemsToPolish; - itemsToPolish.clear(); - - for (QSet::iterator it = itms.begin(); it != itms.end(); ++it) { - QQuickItem *item = *it; - QQuickItemPrivate::get(item)->polishScheduled = false; - item->updatePolish(); - } - } - - if (maxPolishCycles == 0) + // An item can trigger polish on another item, or itself for that matter, + // during its updatePolish() call. Because of this, we cannot simply + // iterate through the set, we must continue pulling items out until it + // is empty. + // In the case where polish is called from updatePolish() either directly + // or indirectly, we use a recursionSafeguard to print a warning to + // the user. + int recursionSafeguard = INT_MAX; + while (!itemsToPolish.isEmpty() && --recursionSafeguard > 0) { + QQuickItem *item = *itemsToPolish.begin(); + itemsToPolish.remove(item); + QQuickItemPrivate::get(item)->polishScheduled = false; + item->updatePolish(); + } + + if (recursionSafeguard == 0) qWarning("QQuickWindow: possible QQuickItem::polish() loop"); updateFocusItemTransform(); -- cgit v1.2.3 From 1c678e09c997ee96563404a28820c5068679e633 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 6 Feb 2015 10:40:03 +0100 Subject: Fix regression where QQuickScreenAttached overwrites QScreen values Up to Qt 5.3 it was fine setting the orientationUpdateMask in QScreen in C++, with 5.4 that value is always discarded and overwrote with 0, this change makes it possible to still set the orientationUpdateMask value in C++ and not have it overwritten unless specifically changed from QML Change-Id: I134290ce91be8b91df4e9e8e71120753813f48d7 Reviewed-by: Alex Blasche --- src/quick/items/qquickscreen.cpp | 11 +++++++++-- src/quick/items/qquickscreen_p.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index 8ac5a1e292..c4d1407697 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -197,7 +197,7 @@ QT_BEGIN_NAMESPACE This contains the update mask for the orientation. Screen::orientation only emits changes for the screen orientations matching this mask. - The default, \c 0, means Screen::orientation never updates. + By default it is set to the value of the QScreen that the window uses. */ QQuickScreenAttached::QQuickScreenAttached(QObject* attachee) @@ -205,6 +205,7 @@ QQuickScreenAttached::QQuickScreenAttached(QObject* attachee) , m_screen(NULL) , m_window(NULL) , m_updateMask(0) + , m_updateMaskSet(false) { m_attachee = qobject_cast(attachee); @@ -297,6 +298,7 @@ Qt::ScreenOrientations QQuickScreenAttached::orientationUpdateMask() const void QQuickScreenAttached::setOrientationUpdateMask(Qt::ScreenOrientations mask) { + m_updateMaskSet = true; if (m_updateMask == mask) return; @@ -338,7 +340,12 @@ void QQuickScreenAttached::screenChanged(QScreen *screen) if (!screen) return; //Don't bother emitting signals, because the new values are garbage anyways - screen->setOrientationUpdateMask(m_updateMask); + if (m_updateMaskSet) { + screen->setOrientationUpdateMask(m_updateMask); + } else if (m_updateMask != screen->orientationUpdateMask()) { + m_updateMask = screen->orientationUpdateMask(); + emit orientationUpdateMaskChanged(); + } if (!oldScreen || screen->size() != oldScreen->size()) { emit widthChanged(); diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h index 257b18cfe0..a36641cc71 100644 --- a/src/quick/items/qquickscreen_p.h +++ b/src/quick/items/qquickscreen_p.h @@ -106,6 +106,7 @@ private: QQuickWindow* m_window; QQuickItem* m_attachee; Qt::ScreenOrientations m_updateMask; + bool m_updateMaskSet; }; class Q_AUTOTEST_EXPORT QQuickScreen : public QObject -- cgit v1.2.3 From 24588556cbd047e6f7b660ba0945187b5963d170 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 6 Feb 2015 11:09:40 +0100 Subject: Doc: fix a file name of an image Change-Id: I6c93fd9d97649eee819a48863b92bde533dabe63 Reviewed-by: Mitch Curtis --- src/quick/doc/images/qml-item-canvas-arc.png | Bin 0 -> 6532 bytes src/quick/doc/images/qml-item-canvas.arc.png | Bin 6532 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/quick/doc/images/qml-item-canvas-arc.png delete mode 100644 src/quick/doc/images/qml-item-canvas.arc.png (limited to 'src') diff --git a/src/quick/doc/images/qml-item-canvas-arc.png b/src/quick/doc/images/qml-item-canvas-arc.png new file mode 100644 index 0000000000..5f9d32d8d3 Binary files /dev/null and b/src/quick/doc/images/qml-item-canvas-arc.png differ diff --git a/src/quick/doc/images/qml-item-canvas.arc.png b/src/quick/doc/images/qml-item-canvas.arc.png deleted file mode 100644 index 5f9d32d8d3..0000000000 Binary files a/src/quick/doc/images/qml-item-canvas.arc.png and /dev/null differ -- cgit v1.2.3 From da6360b85d311d94b8d19126286404c0cc8c76fe Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Fri, 23 Jan 2015 14:33:35 -0800 Subject: Fix crash when invalidating qqmltypeloader Change-Id: I16db2ea9a6c25d26e2b803b9bb8d9ef7156e254d Reviewed-by: Gunnar Sletta Reviewed-by: Simon Hausmann --- src/qml/qml/qqmltypeloader.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 1b222fe1a3..0ac1d7fabd 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -903,15 +903,18 @@ QQmlDataLoader::~QQmlDataLoader() void QQmlDataLoader::invalidate() { - for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter) - (*iter)->release(); - m_networkReplies.clear(); - if (m_thread) { shutdownThread(); delete m_thread; m_thread = 0; } + + // Need to delete the network replies after + // the loader thread is shutdown as it could be + // getting new replies while we clear them + for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter) + (*iter)->release(); + m_networkReplies.clear(); } void QQmlDataLoader::lock() -- cgit v1.2.3 From fd395141f00ef0fc72e2d6b7da0c6397324036a3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 30 Jan 2015 11:54:44 +0100 Subject: Update C++11 warning logic from QtWebKit Fixes compatibility with gcc 5.0. Change-Id: I017c6d690c1f64359c3bac6c8b6b0f5e089861eb Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/3rdparty/masm/masm.pri | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/3rdparty/masm/masm.pri b/src/3rdparty/masm/masm.pri index 3fd4aa6cec..3655af36b6 100644 --- a/src/3rdparty/masm/masm.pri +++ b/src/3rdparty/masm/masm.pri @@ -71,18 +71,16 @@ retgen.commands = python $$retgen.script > ${QMAKE_FILE_OUT} QMAKE_EXTRA_COMPILERS += retgen # Taken from WebKit/Tools/qmake/mkspecs/features/unix/default_post.prf -linux-g++* { - greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 5) { - !contains(QMAKE_CXXFLAGS, -std=(c|gnu)\\+\\+(0x|11)) { +!c++11:!intel_icc { + # Don't warn about OVERRIDE and FINAL, since they are feature-checked anyways + clang { + QMAKE_CXXFLAGS += -Wno-c++11-extensions -Wno-c++0x-extensions + QMAKE_OBJECTIVE_CFLAGS += -Wno-c++11-extensions -Wno-c++0x-extensions + } else: gcc { + greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 5) { # We need to deactivate those warnings because some names conflicts with upcoming c++0x types (e.g.nullptr). QMAKE_CXXFLAGS_WARN_ON += -Wno-c++0x-compat QMAKE_CXXFLAGS += -Wno-c++0x-compat } } } - -# Don't warn about OVERRIDE and FINAL, since they are feature-checked anyways -*clang:!contains(QMAKE_CXXFLAGS, -std=c++11) { - QMAKE_CXXFLAGS += -Wno-c++11-extensions - QMAKE_OBJECTIVE_CFLAGS += -Wno-c++11-extensions -} -- cgit v1.2.3 From c6f0e3967992780e7786d6bdd90b21149009f2fd Mon Sep 17 00:00:00 2001 From: Troels Nilsson Date: Wed, 21 Jan 2015 14:18:35 +0100 Subject: Fix QML Timer running not being updated together with triggered signal The running property of the QML Timer should be updated at the same time as the triggered signal is emitted, otherwise code like e.g. the following: if (qmlTimer.running) { qmlTimer.stop() } doesn't work as expected. In addition if the timer is stopped or restarted between posting the QEvent_Triggered event and receiving it, the triggered event should not be emitted. This avoids the issue of stopped timers still emitting the triggered signal which can potentially cause problems in existing code. Task-number: QTBUG-44026 Change-Id: Ia14d80d152967d09adc1586467715b2e1c6662cc Reviewed-by: Gunnar Sletta --- src/qml/types/qqmltimer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/qml/types/qqmltimer.cpp b/src/qml/types/qqmltimer.cpp index ddadd6cc91..8cbcf7a349 100644 --- a/src/qml/types/qqmltimer.cpp +++ b/src/qml/types/qqmltimer.cpp @@ -329,7 +329,11 @@ bool QQmlTimer::event(QEvent *e) ticked(); return true; } else if (e->type() == QEvent_Triggered) { - emit triggered(); + if (d->running && d->pause.isStopped()) { + d->running = false; + emit triggered(); + emit runningChanged(); + } return true; } return QObject::event(e); @@ -340,10 +344,8 @@ void QQmlTimerPrivate::animationFinished(QAbstractAnimationJob *) Q_Q(QQmlTimer); if (repeating || !running) return; - running = false; firstTick = false; QCoreApplication::postEvent(q, new QEvent(QEvent_Triggered)); - emit q->runningChanged(); } QT_END_NAMESPACE -- cgit v1.2.3 From 1cb329aaaa68ead31c0ae91a69193c7ae08e25b0 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Thu, 12 Feb 2015 15:36:44 +1000 Subject: Fix width/height property assignment during animations. During animations the behavior of anchors.fill: parent and width: parent.width height: parent.height can be different resulting in subtle UI bugs where the final value of a property is not applied because it is within epsilon of the previous value. Fixed by directly comparing the width and height instead of using operator==(QSize, QSize) which does a fuzzy comparison. Change-Id: I4288b93db2b7baacd9f71ae1932ae743a428313a Reviewed-by: Andrew den Exter Reviewed-by: Gunnar Sletta --- src/quick/items/qquickitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 6a00f80171..d1369fb3ff 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -6372,7 +6372,7 @@ void QQuickItem::setSize(const QSizeF &size) d->heightValid = true; d->widthValid = true; - if (QSizeF(d->width, d->height) == size) + if (d->width == size.width() && d->height == size.height()) return; qreal oldHeight = d->height; -- cgit v1.2.3 From 01fab234c6b0c8b770a8567e8beb0f4f6f9bc4be Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 12 Feb 2015 17:39:34 +0100 Subject: Doc: fix example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I818e0a3235060fa48c61d4f21f1202d976b15d5e Task-number: QTBUG-38456 Reviewed-by: Topi Reiniö --- src/quick/util/qquickimageprovider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp index db3828262e..d775aa03b9 100644 --- a/src/quick/util/qquickimageprovider.cpp +++ b/src/quick/util/qquickimageprovider.cpp @@ -184,7 +184,8 @@ QImage QQuickTextureFactory::image() const { ... - QQmlEngine engine; + QQuickView view; + QQmlEngine *engine = view.engine(); engine->addImageProvider(QLatin1String("colors"), new ColorPixmapProvider); ... -- cgit v1.2.3 From c4fcbe9e342f5fa7b86b7facc662575a3f21689b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Sun, 15 Feb 2015 12:13:03 +0000 Subject: docs: Add a link to Drag and DropArea in MouseArea's drag section They are related subjects so deserve a mention. Change-Id: I52f338402c8568f54dfd4b91845f9fafa762ca4d Reviewed-by: Alan Alpert --- src/quick/items/qquickmousearea.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index dc7ba96c35..df9ed1810d 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -1275,6 +1275,8 @@ void QQuickMouseArea::setCursorShape(Qt::CursorShape shape) started. If set to \c false, the target will be moved straight to the current mouse position. By default, this property is \c true. This property was added in Qt Quick 2.4 + See the \l Drag attached property and \l DropArea if you want to make a drop. + \snippet qml/mousearea/mouseareadragfilter.qml dragfilter */ -- cgit v1.2.3