aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-10 10:06:39 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-10 10:06:39 +0200
commit0932a59971f606f07b41da19f3974d51b7008180 (patch)
tree191aab5e88e7b4ddf3724dcbf3b8229512e433f2 /src
parentaca40a8361996e22ec4f020b803404031a0f0d76 (diff)
parentcd0efef04bd45eca6cc72b5a000e4e5586153290 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Part of 0e053528 was reverted in the merge, about lastTimestamp. It will be applied later in separate commit. qmltest::shadersource-dynamic-sourceobject::test_endresult() was blacklisted on linux. Conflicts: .qmake.conf tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp tests/auto/qmltest/BLACKLIST tests/auto/qmltest/qmltest.pro Task-number: QTBUG-53590 Task-number: QTBUG-53971 Change-Id: I48af90b49a3c7b29de16f4178a04807f8bc05130
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/masm/wtf/MathExtras.h2
-rw-r--r--src/imports/localstorage/plugin.cpp18
-rw-r--r--src/imports/statemachine/signaltransition.cpp26
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp8
-rw-r--r--src/qml/compiler/qv4codegen.cpp5
-rw-r--r--src/qml/jit/qv4regalloc.cpp1
-rw-r--r--src/qml/jsruntime/qv4engine.cpp8
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper_p.h2
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h2
-rw-r--r--src/qml/qml.pro5
-rw-r--r--src/qml/types/qqmllistmodel.cpp2
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc6
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp10
-rw-r--r--src/quick/items/qquickflickable.cpp2
-rw-r--r--src/quick/items/qquickitem.cpp33
-rw-r--r--src/quick/items/qquickitemgrabresult.cpp3
-rw-r--r--src/quick/items/qquickmousearea.cpp21
-rw-r--r--src/quick/items/qquickmousearea_p_p.h1
-rw-r--r--src/quick/items/qquickpathview.cpp2
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp5
-rw-r--r--src/quick/items/qquickwindow.cpp31
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.cpp6
22 files changed, 146 insertions, 53 deletions
diff --git a/src/3rdparty/masm/wtf/MathExtras.h b/src/3rdparty/masm/wtf/MathExtras.h
index 9ded0ab736..28a189b6e6 100644
--- a/src/3rdparty/masm/wtf/MathExtras.h
+++ b/src/3rdparty/masm/wtf/MathExtras.h
@@ -106,7 +106,7 @@ inline bool isinf(double x) { return !finite(x) && !isnand(x); }
#endif
-#if OS(OPENBSD)
+#if OS(OPENBSD) && __cplusplus < 201103L
namespace std {
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 89ed60ec84..a043af6b46 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -270,6 +270,15 @@ static ReturnedValue qmlsqldatabase_rows_item(CallContext *ctx)
return qmlsqldatabase_rows_index(r, scope.engine, ctx->argc() ? ctx->args()[0].toUInt32() : 0);
}
+static QVariant toSqlVariant(QV4::ExecutionEngine *engine, const QV4::ScopedValue &value)
+{
+ // toVariant() maps a null JS value to QVariant(VoidStar), but the SQL module
+ // expects a null variant. (this is because of QTBUG-40880)
+ if (value->isNull())
+ return QVariant();
+ return engine->toVariant(value, /*typehint*/-1);
+}
+
static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
{
QV4::Scope scope(ctx);
@@ -300,8 +309,9 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
ScopedArrayObject array(scope, values);
quint32 size = array->getLength();
QV4::ScopedValue v(scope);
- for (quint32 ii = 0; ii < size; ++ii)
- query.bindValue(ii, scope.engine->toVariant((v = array->getIndexed(ii)), -1));
+ for (quint32 ii = 0; ii < size; ++ii) {
+ query.bindValue(ii, toSqlVariant(scope.engine, (v = array->getIndexed(ii))));
+ }
} else if (values->as<Object>()) {
ScopedObject object(scope, values);
ObjectIterator it(scope, object, ObjectIterator::WithProtoChain|ObjectIterator::EnumerableOnly);
@@ -311,7 +321,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
key = it.nextPropertyName(val);
if (key->isNull())
break;
- QVariant v = scope.engine->toVariant(val, -1);
+ QVariant v = toSqlVariant(scope.engine, val);
if (key->isString()) {
query.bindValue(key->stringValue()->toQString(), v);
} else {
@@ -320,7 +330,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
}
}
} else {
- query.bindValue(0, scope.engine->toVariant(values, -1));
+ query.bindValue(0, toSqlVariant(scope.engine, values));
}
}
if (query.exec()) {
diff --git a/src/imports/statemachine/signaltransition.cpp b/src/imports/statemachine/signaltransition.cpp
index 508e1e3685..f9de70263c 100644
--- a/src/imports/statemachine/signaltransition.cpp
+++ b/src/imports/statemachine/signaltransition.cpp
@@ -112,15 +112,27 @@ void SignalTransition::setSignal(const QJSValue &signal)
QV4::ExecutionEngine *jsEngine = QV8Engine::getV4(QQmlEngine::contextForObject(this)->engine());
QV4::Scope scope(jsEngine);
- QV4::Scoped<QV4::QObjectMethod> qobjectSignal(scope, QJSValuePrivate::convertedToValue(jsEngine, m_signal));
- Q_ASSERT(qobjectSignal);
-
- QObject *sender = qobjectSignal->object();
- Q_ASSERT(sender);
- QMetaMethod metaMethod = sender->metaObject()->method(qobjectSignal->methodIndex());
+ QObject *sender;
+ QMetaMethod signalMethod;
+
+ QV4::ScopedValue value(scope, QJSValuePrivate::convertedToValue(jsEngine, m_signal));
+
+ // Did we get the "slot" that can be used to invoke the signal?
+ if (QV4::QObjectMethod *signalSlot = value->as<QV4::QObjectMethod>()) {
+ sender = signalSlot->object();
+ Q_ASSERT(sender);
+ signalMethod = sender->metaObject()->method(signalSlot->methodIndex());
+ } else if (QV4::QmlSignalHandler *signalObject = value->as<QV4::QmlSignalHandler>()) { // or did we get the signal object (the one with the connect()/disconnect() functions) ?
+ sender = signalObject->object();
+ Q_ASSERT(sender);
+ signalMethod = sender->metaObject()->method(signalObject->signalIndex());
+ } else {
+ qmlInfo(this) << tr("Specified signal does not exist.");
+ return;
+ }
QSignalTransition::setSenderObject(sender);
- QSignalTransition::setSignal(metaMethod.methodSignature());
+ QSignalTransition::setSignal(signalMethod.methodSignature());
connectTriggered();
}
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
index a639cfb71e..e17722bb3d 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
@@ -431,20 +431,24 @@ void QQmlProfilerServiceImpl::messageReceived(const QByteArray &message)
void QQmlProfilerServiceImpl::flush()
{
QMutexLocker lock(&m_configMutex);
+ QList<QQmlAbstractProfilerAdapter *> reporting;
foreach (QQmlAbstractProfilerAdapter *profiler, m_engineProfilers) {
if (profiler->isRunning()) {
m_startTimes.insert(-1, profiler);
- profiler->reportData();
+ reporting.append(profiler);
}
}
foreach (QQmlAbstractProfilerAdapter *profiler, m_globalProfilers) {
if (profiler->isRunning()) {
m_startTimes.insert(-1, profiler);
- profiler->reportData();
+ reporting.append(profiler);
}
}
+
+ foreach (QQmlAbstractProfilerAdapter *profiler, reporting)
+ profiler->reportData();
}
QT_END_NAMESPACE
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index d08d2aafa2..f5733b96f0 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2724,6 +2724,9 @@ bool Codegen::visit(WithStatement *ast)
_function->hasWith = true;
+ const int withObject = _block->newTemp();
+ _block->MOVE(_block->TEMP(withObject), *expression(ast->expression));
+
// need an exception handler for with to cleanup the with scope
IR::BasicBlock *withExceptionHandler = _function->newBasicBlock(exceptionHandler());
withExceptionHandler->EXP(withExceptionHandler->CALL(withExceptionHandler->NAME(IR::Name::builtin_pop_scope, 0, 0), 0));
@@ -2738,8 +2741,6 @@ bool Codegen::visit(WithStatement *ast)
_block->JUMP(withBlock);
_block = withBlock;
- int withObject = _block->newTemp();
- _block->MOVE(_block->TEMP(withObject), *expression(ast->expression));
IR::ExprList *args = _function->New<IR::ExprList>();
args->init(_block->TEMP(withObject));
_block->EXP(_block->CALL(_block->NAME(IR::Name::builtin_push_with_scope, 0, 0), args));
diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp
index 131e0a5b0a..c21f52ecd3 100644
--- a/src/qml/jit/qv4regalloc.cpp
+++ b/src/qml/jit/qv4regalloc.cpp
@@ -839,6 +839,7 @@ public:
, _assignedSpillSlots(assignedSpillSlots)
, _intRegs(intRegs)
, _fpRegs(fpRegs)
+ , _currentStmt(0)
{
_unprocessed = unprocessed;
_liveAtStart.reserve(function->basicBlockCount());
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index d9692a0876..15a4ed2e56 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -188,6 +188,10 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
/* writable */ true, /* executable */ false,
/* includesGuardPages */ true);
jsStackBase = (Value *)jsStack->base();
+#ifdef V4_USE_VALGRIND
+ VALGRIND_MAKE_MEM_UNDEFINED(jsStackBase, 2*JSStackLimit);
+#endif
+
jsStackTop = jsStackBase;
exceptionValue = jsAlloca(1);
@@ -197,10 +201,6 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
typedArrayCtors = static_cast<FunctionObject *>(jsAlloca(NTypedArrayTypes));
jsStrings = jsAlloca(NJSStrings);
-#ifdef V4_USE_VALGRIND
- VALGRIND_MAKE_MEM_UNDEFINED(jsStackBase, 2*JSStackLimit);
-#endif
-
// set up stack limits
jsStackLimit = jsStackBase + JSStackLimit/sizeof(Value);
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h
index d2650efd58..f101f352f1 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper_p.h
+++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h
@@ -191,7 +191,7 @@ struct Q_QML_EXPORT QObjectMethod : public QV4::FunctionObject
static void markObjects(Heap::Base *that, QV4::ExecutionEngine *e);
};
-struct QmlSignalHandler : public QV4::Object
+struct Q_QML_EXPORT QmlSignalHandler : public QV4::Object
{
V4_OBJECT2(QmlSignalHandler, QV4::Object)
V4_PROTOTYPE(signalHandlerPrototype)
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index e01571c3d6..58797f5eda 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -88,7 +88,7 @@ struct Scope {
memset(mark, 0, (engine->jsStackTop - mark)*sizeof(Value));
#endif
#ifdef V4_USE_VALGRIND
- VALGRIND_MAKE_MEM_UNDEFINED(mark, engine->jsStackLimit - mark);
+ VALGRIND_MAKE_MEM_UNDEFINED(mark, (engine->jsStackLimit - mark) * sizeof(Value));
#endif
engine->jsStackTop = mark;
}
diff --git a/src/qml/qml.pro b/src/qml/qml.pro
index e30c39c8b9..f4862a17a6 100644
--- a/src/qml/qml.pro
+++ b/src/qml/qml.pro
@@ -16,6 +16,11 @@ exists("qqml_enable_gcov") {
LIBS_PRIVATE += -lgcov
}
+greaterThan(QT_GCC_MAJOR_VERSION, 5) {
+ # Our code is bad. Temporary workaround.
+ QMAKE_CXXFLAGS += -fno-delete-null-pointer-checks
+}
+
QMAKE_DOCS = $$PWD/doc/qtqml.qdocconf
# 2415: variable "xx" of static storage duration was declared but never referenced
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 44a4ff03e9..1e1ebc4939 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -396,6 +396,8 @@ void ListModel::updateCacheIndices()
QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQmlListModel *owner, QV4::ExecutionEngine *eng)
{
+ if (roleIndex >= m_layout->roleCount())
+ return QVariant();
ListElement *e = elements[elementIndex];
const ListLayout::Role &r = m_layout->getExistingRole(roleIndex);
return e->getProperty(r, owner, eng);
diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
index 443d189f58..516630d034 100644
--- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
@@ -180,8 +180,8 @@ dedicated thread. Qt attempts to choose a suitable loop based on the
platform and possibly the graphics drivers in use. When this is not
satisfactory, or for testing purposes, the environment variable
\c QSG_RENDER_LOOP can be used to force the usage of a given loop. To
-verify which render loop is in use, launch the application with
-\c QSG_INFO set to \c 1.
+verify which render loop is in use, enable the \c qt.scenegraph.info
+\l {QLoggingCategory}{logging category}.
\note The \c threaded and \c windows render loops rely on the OpenGL
implementation for throttling by requesting a swap interval of 1. Some
@@ -214,7 +214,7 @@ user input. An event is posted to the render thread to initiate a new
frame.
\li The render thread prepares to draw a new frame and makes the
-OpenGL context current and initiates a blocks on the GUI thread.
+OpenGL context current and initiates a block on the GUI thread.
\li While the render thread is preparing the new frame, the GUI thread
calls QQuickItem::updatePolish() to do final touch-up of items before
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 4abcc722d1..b3b5144eb3 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -682,10 +682,14 @@ void QQuickCanvasItem::itemChange(QQuickItem::ItemChange change, const QQuickIte
QSGRenderContext *context = QQuickWindowPrivate::get(d->window)->context;
// Rendering to FramebufferObject needs a valid OpenGL context.
- if (context != 0 && (d->renderTarget != FramebufferObject || context->isValid()))
- sceneGraphInitialized();
- else
+ if (context != 0 && (d->renderTarget != FramebufferObject || context->isValid())) {
+ // Defer the call. In some (arguably incorrect) cases we get here due
+ // to ItemSceneChange with the user-supplied property values not yet
+ // set. Work this around by a deferred invoke. (QTBUG-49692)
+ QMetaObject::invokeMethod(this, "sceneGraphInitialized", Qt::QueuedConnection);
+ } else {
connect(d->window, SIGNAL(sceneGraphInitialized()), SLOT(sceneGraphInitialized()));
+ }
}
void QQuickCanvasItem::updatePolish()
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 1853a1d948..1bcc3cc0f9 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -65,7 +65,9 @@ static const int FlickThreshold = 15;
// will ensure the Flickable retains the grab on consecutive flicks.
static const int RetainGrabVelocity = 100;
+#ifdef Q_OS_OSX
static const int MovementEndingTimerInterval = 100;
+#endif
static qreal EaseOvershoot(qreal t) {
return qAtan(t);
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 3573788855..67a2b8a892 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -421,21 +421,44 @@ void QQuickItemKeyFilter::componentComplete()
/*!
\qmlproperty Item QtQuick::KeyNavigation::left
+
+ This property holds the item to assign focus to
+ when the left cursor key is pressed.
+*/
+
+/*!
\qmlproperty Item QtQuick::KeyNavigation::right
+
+ This property holds the item to assign focus to
+ when the right cursor key is pressed.
+*/
+
+/*!
\qmlproperty Item QtQuick::KeyNavigation::up
+
+ This property holds the item to assign focus to
+ when the up cursor key is pressed.
+*/
+
+/*!
\qmlproperty Item QtQuick::KeyNavigation::down
- These properties hold the item to assign focus to
- when the left, right, up or down cursor keys
- are pressed.
+ This property holds the item to assign focus to
+ when the down cursor key is pressed.
*/
/*!
\qmlproperty Item QtQuick::KeyNavigation::tab
+
+ This property holds the item to assign focus to
+ when the Tab key is pressed.
+*/
+
+/*!
\qmlproperty Item QtQuick::KeyNavigation::backtab
- These properties hold the item to assign focus to
- when the Tab key or Shift+Tab key combination (Backtab) are pressed.
+ This property holds the item to assign focus to
+ when the Shift+Tab key combination (Backtab) is pressed.
*/
QQuickKeyNavigationAttached::QQuickKeyNavigationAttached(QObject *parent)
diff --git a/src/quick/items/qquickitemgrabresult.cpp b/src/quick/items/qquickitemgrabresult.cpp
index 5820c0b007..f8327a1c6e 100644
--- a/src/quick/items/qquickitemgrabresult.cpp
+++ b/src/quick/items/qquickitemgrabresult.cpp
@@ -327,7 +327,8 @@ QSharedPointer<QQuickItemGrabResult> QQuickItem::grabToImage(const QSize &target
* Grabs the item into an in-memory image.
*
* The grab happens asynchronously and the JavaScript function \a callback is
- * invoked when the grab is completed.
+ * invoked when the grab is completed. The callback takes one argument, which
+ * is the result of the grab operation; an \l ItemGrabResult object.
*
* Use \a targetSize to specify the size of the target image. By default, the result
* will have the same size as the item.
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index 920a86881b..234105986a 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -58,7 +58,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlVisualTouchDebugging, QML_VISUAL_TOUCH_DEBUGGING)
QQuickMouseAreaPrivate::QQuickMouseAreaPrivate()
: enabled(true), scrollGestureEnabled(true), hovered(false), longPress(false),
moved(false), stealMouse(false), doubleClick(false), preventStealing(false),
- propagateComposedEvents(false), pressed(0)
+ propagateComposedEvents(false), overThreshold(false), pressed(0)
#ifndef QT_NO_DRAGANDDROP
, drag(0)
#endif
@@ -721,7 +721,7 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event)
curLocalPos = event->windowPos();
}
- if (keepMouseGrab() && d->stealMouse && !d->drag->active())
+ if (keepMouseGrab() && d->stealMouse && d->overThreshold && !d->drag->active())
d->drag->setActive(true);
QPointF startPos = d->drag->target()->parentItem()
@@ -747,16 +747,19 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event)
if (d->drag->active())
d->drag->target()->setPosition(dragPos);
- if (!keepMouseGrab()
- && (QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(), Qt::XAxis, event, d->drag->threshold())
- || QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), Qt::YAxis, event, d->drag->threshold()))) {
- setKeepMouseGrab(true);
- d->stealMouse = true;
-
+ if (!d->overThreshold && (QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(), Qt::XAxis, event, d->drag->threshold())
+ || QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), Qt::YAxis, event, d->drag->threshold())))
+ {
+ d->overThreshold = true;
if (d->drag->smoothed())
d->startScene = event->windowPos();
}
+ if (!keepMouseGrab() && d->overThreshold) {
+ setKeepMouseGrab(true);
+ d->stealMouse = true;
+ }
+
d->moved = true;
}
#endif
@@ -774,6 +777,7 @@ void QQuickMouseArea::mouseReleaseEvent(QMouseEvent *event)
{
Q_D(QQuickMouseArea);
d->stealMouse = false;
+ d->overThreshold = false;
if (!d->enabled && !d->pressed) {
QQuickItem::mouseReleaseEvent(event);
} else {
@@ -883,6 +887,7 @@ void QQuickMouseArea::ungrabMouse()
d->pressed = 0;
d->stealMouse = false;
d->doubleClick = false;
+ d->overThreshold = false;
setKeepMouseGrab(false);
#ifndef QT_NO_DRAGANDDROP
diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h
index 2d841b9ae1..dc00ffe52c 100644
--- a/src/quick/items/qquickmousearea_p_p.h
+++ b/src/quick/items/qquickmousearea_p_p.h
@@ -92,6 +92,7 @@ public:
bool doubleClick : 1;
bool preventStealing : 1;
bool propagateComposedEvents : 1;
+ bool overThreshold : 1;
Qt::MouseButtons pressed;
#ifndef QT_NO_DRAGANDDROP
QQuickDrag *drag;
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index e3d218ff01..7bb52853bc 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -1026,7 +1026,7 @@ void QQuickPathView::setHighlightMoveDuration(int duration)
/*!
\qmlproperty real QtQuick::PathView::dragMargin
- This property holds the maximum distance from the path that initiate mouse dragging.
+ This property holds the maximum distance from the path that initiates mouse dragging.
By default the path can only be dragged by clicking on an item. If
dragMargin is greater than zero, a drag can be initiated by clicking
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index 2872c3e230..ef94b0eef7 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -642,9 +642,12 @@ void QQuickTextNodeEngine::addBorder(const QRectF &rect, qreal border,
void QQuickTextNodeEngine::addFrameDecorations(QTextDocument *document, QTextFrame *frame)
{
QTextDocumentLayout *documentLayout = qobject_cast<QTextDocumentLayout *>(document->documentLayout());
- QTextFrameFormat frameFormat = frame->format().toFrameFormat();
+ if (Q_UNLIKELY(!documentLayout))
+ return;
+ QTextFrameFormat frameFormat = frame->format().toFrameFormat();
QTextTable *table = qobject_cast<QTextTable *>(frame);
+
QRectF boundingRect = table == 0
? documentLayout->frameBoundingRect(frame)
: documentLayout->tableBoundingRect(table);
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index b06cfe54cc..9ef651bffa 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -830,8 +830,10 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q
QQuickItemPrivate *scopePrivate = scope ? QQuickItemPrivate::get(scope) : 0;
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
+ QQuickItem *oldActiveFocusItem = 0;
QQuickItem *currentActiveFocusItem = activeFocusItem;
QQuickItem *newActiveFocusItem = 0;
+ bool sendFocusIn = false;
lastFocusReason = reason;
@@ -839,7 +841,6 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q
// Does this change the active focus?
if (item == contentItem || scopePrivate->activeFocus) {
- QQuickItem *oldActiveFocusItem = 0;
oldActiveFocusItem = activeFocusItem;
if (item->isEnabled()) {
newActiveFocusItem = item;
@@ -858,8 +859,6 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q
#endif
activeFocusItem = 0;
- QFocusEvent event(QEvent::FocusOut, reason);
- q->sendEvent(oldActiveFocusItem, &event);
QQuickItem *afi = oldActiveFocusItem;
while (afi && afi != scope) {
@@ -904,7 +903,19 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q
afi = afi->parentItem();
}
updateFocusItemTransform();
+ sendFocusIn = true;
+ }
+
+ // Now that all the state is changed, emit signals & events
+ // We must do this last, as this process may result in further changes to
+ // focus.
+ if (oldActiveFocusItem) {
+ QFocusEvent event(QEvent::FocusOut, reason);
+ q->sendEvent(oldActiveFocusItem, &event);
+ }
+ // Make sure that the FocusOut didn't result in another focus change.
+ if (sendFocusIn && activeFocusItem == newActiveFocusItem) {
QFocusEvent event(QEvent::FocusIn, reason);
q->sendEvent(newActiveFocusItem, &event);
}
@@ -957,9 +968,6 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
activeFocusItem = 0;
if (oldActiveFocusItem) {
- QFocusEvent event(QEvent::FocusOut, reason);
- q->sendEvent(oldActiveFocusItem, &event);
-
QQuickItem *afi = oldActiveFocusItem;
while (afi && afi != scope) {
if (QQuickItemPrivate::get(afi)->activeFocus) {
@@ -989,7 +997,18 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
Q_ASSERT(newActiveFocusItem == scope);
activeFocusItem = scope;
updateFocusItemTransform();
+ }
+
+ // Now that all the state is changed, emit signals & events
+ // We must do this last, as this process may result in further changes to
+ // focus.
+ if (oldActiveFocusItem) {
+ QFocusEvent event(QEvent::FocusOut, reason);
+ q->sendEvent(oldActiveFocusItem, &event);
+ }
+ // Make sure that the FocusOut didn't result in another focus change.
+ if (newActiveFocusItem && activeFocusItem == newActiveFocusItem) {
QFocusEvent event(QEvent::FocusIn, reason);
q->sendEvent(newActiveFocusItem, &event);
}
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp
index 223c555f3e..53798f0e07 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.cpp
+++ b/src/quick/scenegraph/coreapi/qsgnode.cpp
@@ -337,12 +337,12 @@ QSGNode::~QSGNode()
to the scene graph and will cause the preprocess() function to be called
for every frame the node is rendered.
- The preprocess function is called before the update pass that propegates
+ The preprocess function is called before the update pass that propagates
opacity and transformations through the scene graph. That means that
functions like QSGOpacityNode::combinedOpacity() and
QSGTransformNode::combinedMatrix() will not contain up-to-date values.
If such values are changed during the preprocess, these changes will be
- propegated through the scene graph before it is rendered.
+ propagated through the scene graph before it is rendered.
\warning Beware of deleting nodes while they are being preprocessed. It is
possible, with a small performance hit, to delete a single node during its
@@ -1337,7 +1337,7 @@ const qreal OPACITY_THRESHOLD = 0.001;
Sets the opacity of this node to \a opacity.
Before rendering the graph, the renderer will do an update pass
- over the subtree to propegate the opacity to its children.
+ over the subtree to propagate the opacity to its children.
The value will be bounded to the range 0 to 1.
*/