diff options
author | Jani Heikkinen <jani.heikkinen@digia.com> | 2014-04-23 12:44:13 +0300 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@digia.com> | 2014-04-23 12:44:14 +0300 |
commit | 7d16c2f40a2995c6bdff3a1999a7cb6100fdf301 (patch) | |
tree | fda2e8a1b363caae655ba1369e54ec0257c7d067 /src | |
parent | aedcd57c84ac9d6b74816c13bdf3fde31e1132b5 (diff) | |
parent | 937fdde5d3b26291d417f856ee05ba479a6ba730 (diff) |
Merge remote-tracking branch 'origin/release' into stable
Change-Id: I1214586499ab2876c8bc55a99367a0c938c8b919
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/masm/assembler/MacroAssemblerARMv7.h | 2 | ||||
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 6 | ||||
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 2 | ||||
-rw-r--r-- | src/qml/jit/qv4assembler_p.h | 6 | ||||
-rw-r--r-- | src/qml/jit/qv4isel_masm.cpp | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 6 | ||||
-rw-r--r-- | src/qml/types/qqmldelegatemodel_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickitem.cpp | 14 | ||||
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 46 | ||||
-rw-r--r-- | src/quick/items/qquicktextcontrol_p.h | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexturematerial.cpp | 2 |
16 files changed, 82 insertions, 20 deletions
diff --git a/src/3rdparty/masm/assembler/MacroAssemblerARMv7.h b/src/3rdparty/masm/assembler/MacroAssemblerARMv7.h index 9a8dc1f358..f492cc8c94 100644 --- a/src/3rdparty/masm/assembler/MacroAssemblerARMv7.h +++ b/src/3rdparty/masm/assembler/MacroAssemblerARMv7.h @@ -39,7 +39,7 @@ class MacroAssemblerARMv7 : public AbstractMacroAssembler<ARMv7Assembler> { // - dTR is likely used more than aTR, and we'll get better instruction // encoding if it's in the low 8 registers. static const RegisterID dataTempRegister = ARMRegisters::ip; - static const RegisterID addressTempRegister = ARMRegisters::r3; + static const RegisterID addressTempRegister = ARMRegisters::r10; static const ARMRegisters::FPDoubleRegisterID fpTempRegister = ARMRegisters::d7; inline ARMRegisters::FPSingleRegisterID fpTempRegisterAsSingle() { return ARMRegisters::asSingle(fpTempRegister); } diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index d1450f051c..1e067c8a1e 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2212,8 +2212,6 @@ bool Codegen::visit(ForEachStatement *ast) IR::BasicBlock *foreachbody = _function->newBasicBlock(foreachin, exceptionHandler()); IR::BasicBlock *foreachend = _function->newBasicBlock(groupStartBlock(), exceptionHandler()); - enterLoop(ast, foreachin, foreachend, foreachin); - int objectToIterateOn = _block->newTemp(); move(_block->TEMP(objectToIterateOn), *expression(ast->expression)); IR::ExprList *args = _function->New<IR::ExprList>(); @@ -2222,6 +2220,7 @@ bool Codegen::visit(ForEachStatement *ast) int iterator = _block->newTemp(); move(_block->TEMP(iterator), _block->CALL(_block->NAME(IR::Name::builtin_foreach_iterator_object, 0, 0), args)); + enterLoop(ast, foreachin, foreachend, foreachin); _block->JUMP(foreachin); _block = foreachbody; @@ -2352,8 +2351,6 @@ bool Codegen::visit(LocalForEachStatement *ast) IR::BasicBlock *foreachbody = _function->newBasicBlock(foreachin, exceptionHandler()); IR::BasicBlock *foreachend = _function->newBasicBlock(groupStartBlock(), exceptionHandler()); - enterLoop(ast, foreachin, foreachend, foreachin); - variableDeclaration(ast->declaration); int iterator = _block->newTemp(); @@ -2363,6 +2360,7 @@ bool Codegen::visit(LocalForEachStatement *ast) move(_block->TEMP(iterator), _block->CALL(_block->NAME(IR::Name::builtin_foreach_iterator_object, 0, 0), args)); _block->JUMP(foreachin); + enterLoop(ast, foreachin, foreachend, foreachin); _block = foreachbody; int temp = _block->newTemp(); diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index afcf2c6a24..a4dcfd9209 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -196,6 +196,8 @@ struct Unit const uint *offsetTable = reinterpret_cast<const uint*>((reinterpret_cast<const char *>(this)) + offsetToStringTable); const uint offset = offsetTable[idx]; const String *str = reinterpret_cast<const String*>(reinterpret_cast<const char *>(this) + offset); + if (str->str.size == 0) + return QString(); QStringDataPtr holder = { const_cast<QStringData *>(static_cast<const QStringData*>(&str->str)) }; QString qstr(holder); if (flags & StaticData) diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h index 19804e7293..6fde517e1f 100644 --- a/src/qml/jit/qv4assembler_p.h +++ b/src/qml/jit/qv4assembler_p.h @@ -219,12 +219,12 @@ public: #define ARGUMENTS_IN_REGISTERS #undef HAVE_ALU_OPS_WITH_MEM_OPERAND - static const RegisterID StackFrameRegister = JSC::ARMRegisters::r4; - static const RegisterID StackPointerRegister = JSC::ARMRegisters::sp; + static const RegisterID StackPointerRegister = JSC::ARMRegisters::sp; // r13 + static const RegisterID StackFrameRegister = JSC::ARMRegisters::fp; // r11 static const RegisterID LocalsRegister = JSC::ARMRegisters::r7; + static const RegisterID ScratchRegister = JSC::ARMRegisters::r6; static const RegisterID ContextRegister = JSC::ARMRegisters::r5; static const RegisterID ReturnValueRegister = JSC::ARMRegisters::r0; - static const RegisterID ScratchRegister = JSC::ARMRegisters::r6; static const FPRegisterID FPGpr0 = JSC::ARMRegisters::d0; static const FPRegisterID FPGpr1 = JSC::ARMRegisters::d1; diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp index 74b404a793..3307fcc0d1 100644 --- a/src/qml/jit/qv4isel_masm.cpp +++ b/src/qml/jit/qv4isel_masm.cpp @@ -258,10 +258,10 @@ static QVector<int> getIntRegisters() static const QVector<int> intRegisters = QVector<int>() << JSC::ARMRegisters::r1 << JSC::ARMRegisters::r2 + << JSC::ARMRegisters::r3 + << JSC::ARMRegisters::r4 << JSC::ARMRegisters::r8 - << JSC::ARMRegisters::r9 - << JSC::ARMRegisters::r10 - << JSC::ARMRegisters::r11; + << JSC::ARMRegisters::r9; return intRegisters; } diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index de556dc9ed..b61be913a6 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -685,7 +685,7 @@ void QObjectWrapper::put(Managed *m, const StringRef name, const ValueRef value) QQmlData *ddata = QQmlData::get(that->m_object); // Types created by QML are not extensible at run-time, but for other QObjects we can store them // as regular JavaScript properties, like on JavaScript objects. - if (ddata && ddata->compiledData) { + if (ddata && ddata->context) { QString error = QLatin1String("Cannot assign to non-existent property \"") + name->toQString() + QLatin1Char('\"'); v4->currentContext()->throwError(error); diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index 0bbcafda54..1075b53c5e 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1403,6 +1403,12 @@ bool QQmlPropertyPrivate::write(QObject *object, v = value; if (v.convert(propertyType)) { ok = true; + } else if (v.isValid() && value.isNull()) { + // For historical reasons converting a null QVariant to another type will do the trick + // but return false anyway. This is caught with the above condition and considered a + // successful conversion. + Q_ASSERT(v.userType() == propertyType); + ok = true; } else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) { QQmlMetaType::StringConverter con = QQmlMetaType::customStringConverter(propertyType); if (con) { diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h index 32b1154d30..7da089c9b8 100644 --- a/src/qml/types/qqmldelegatemodel_p_p.h +++ b/src/qml/types/qqmldelegatemodel_p_p.h @@ -144,7 +144,7 @@ public: QQmlDelegateModelItemMetaType * const metaType; QQmlContextData *contextData; QObject *object; - QQmlDelegateModelAttached *attached; + QPointer<QQmlDelegateModelAttached> attached; QQDMIncubationTask *incubationTask; int objectRef; int scriptRef; diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp index 06a0713365..5697c25ff0 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp @@ -214,6 +214,8 @@ void QQuickContext2DCommandBuffer::setPainterState(QPainter* p, const QQuickCont if (state.globalCompositeOperation != p->compositionMode()) p->setCompositionMode(state.globalCompositeOperation); + + p->setClipPath(state.clipPath); } static void qt_drawImage(QPainter *p, QQuickContext2D::State& state, QImage image, const QRectF& sr, const QRectF& dr, bool shadow = false) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 691fea21e1..3f0dae8070 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -1333,7 +1333,7 @@ void QQuickKeysAttached::keyPressed(QKeyEvent *event, bool post) for (int ii = 0; ii < d->targets.count(); ++ii) { QQuickItem *i = d->targets.at(ii); if (i && i->isVisible()) { - d->item->window()->sendEvent(i, event); + QCoreApplication::sendEvent(i, event); if (event->isAccepted()) { d->inPress = false; return; @@ -1375,7 +1375,7 @@ void QQuickKeysAttached::keyReleased(QKeyEvent *event, bool post) for (int ii = 0; ii < d->targets.count(); ++ii) { QQuickItem *i = d->targets.at(ii); if (i && i->isVisible()) { - d->item->window()->sendEvent(i, event); + QCoreApplication::sendEvent(i, event); if (event->isAccepted()) { d->inRelease = false; return; @@ -6391,10 +6391,12 @@ void QQuickItem::setFocus(bool focus, Qt::FocusReason reason) while (scope && !scope->isFocusScope() && scope->parentItem()) scope = scope->parentItem(); if (d->window) { - if (focus) - QQuickWindowPrivate::get(d->window)->setFocusInScope(scope, this, reason); - else - QQuickWindowPrivate::get(d->window)->clearFocusInScope(scope, this, reason); + if (reason != Qt::PopupFocusReason) { + if (focus) + QQuickWindowPrivate::get(d->window)->setFocusInScope(scope, this, reason); + else + QQuickWindowPrivate::get(d->window)->clearFocusInScope(scope, this, reason); + } } else { // do the focus changes from setFocusInScope/clearFocusInScope that are // unrelated to a window diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 46eec643fd..b4f6c34c6a 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -364,6 +364,8 @@ void QQuickItemView::setDelegate(QQmlComponent *delegate) if (!d->ownModel) { d->model = new QQmlDelegateModel(qmlContext(this)); d->ownModel = true; + if (isComponentComplete()) + static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete(); } if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)) { int oldCount = dataModel->count(); diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index ec789670ab..45cd8e184c 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -1242,6 +1242,8 @@ void QQuickPathView::setDelegate(QQmlComponent *delegate) if (!d->ownModel) { d->model = new QQmlDelegateModel(qmlContext(this)); d->ownModel = true; + if (isComponentComplete()) + static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete(); } if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)) { int oldCount = dataModel->count(); diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index 0a9677bd4e..53d736fb36 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -1365,6 +1365,11 @@ void QQuickTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) QVariant QQuickTextControl::inputMethodQuery(Qt::InputMethodQuery property) const { + return inputMethodQuery(property, QVariant()); +} + +QVariant QQuickTextControl::inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const +{ Q_D(const QQuickTextControl); QTextBlock block = d->cursor.block(); switch (property) { @@ -1382,6 +1387,47 @@ QVariant QQuickTextControl::inputMethodQuery(Qt::InputMethodQuery property) cons return QVariant(); // No limit. case Qt::ImAnchorPosition: return QVariant(d->cursor.anchor() - block.position()); + case Qt::ImAbsolutePosition: + return QVariant(d->cursor.anchor()); + case Qt::ImTextAfterCursor: + { + int maxLength = argument.isValid() ? argument.toInt() : 1024; + QTextCursor tmpCursor = d->cursor; + int localPos = d->cursor.position() - block.position(); + QString result = block.text().mid(localPos); + while (result.length() < maxLength) { + int currentBlock = tmpCursor.blockNumber(); + tmpCursor.movePosition(QTextCursor::NextBlock); + if (tmpCursor.blockNumber() == currentBlock) + break; + result += QLatin1Char('\n') + tmpCursor.block().text(); + } + return QVariant(result); + } + case Qt::ImTextBeforeCursor: + { + int maxLength = argument.isValid() ? argument.toInt() : 1024; + QTextCursor tmpCursor = d->cursor; + int localPos = d->cursor.position() - block.position(); + int numBlocks = 0; + int resultLen = localPos; + while (resultLen < maxLength) { + int currentBlock = tmpCursor.blockNumber(); + tmpCursor.movePosition(QTextCursor::PreviousBlock); + if (tmpCursor.blockNumber() == currentBlock) + break; + numBlocks++; + resultLen += tmpCursor.block().length(); + } + QString result; + while (numBlocks) { + result += tmpCursor.block().text() + QLatin1Char('\n'); + tmpCursor.movePosition(QTextCursor::NextBlock); + --numBlocks; + } + result += block.text().mid(0,localPos); + return QVariant(result); + } default: return QVariant(); } diff --git a/src/quick/items/qquicktextcontrol_p.h b/src/quick/items/qquicktextcontrol_p.h index bc5371b0c3..39221ced11 100644 --- a/src/quick/items/qquicktextcontrol_p.h +++ b/src/quick/items/qquicktextcontrol_p.h @@ -160,6 +160,7 @@ public: #ifndef QT_NO_IM virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const; + Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif virtual QMimeData *createMimeDataFromSelection() const; diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index ec563273a1..c6e5f7ac7b 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -567,6 +567,7 @@ void QSGPlainTexture::setImage(const QImage &image) m_has_alpha = image.hasAlphaChannel(); m_dirty_texture = true; m_dirty_bind_options = true; + m_mipmaps_generated = false; } int QSGPlainTexture::textureId() const diff --git a/src/quick/scenegraph/util/qsgtexturematerial.cpp b/src/quick/scenegraph/util/qsgtexturematerial.cpp index fcdb4fcdfe..afa535d322 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial.cpp +++ b/src/quick/scenegraph/util/qsgtexturematerial.cpp @@ -152,7 +152,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa QSGOpaqueTextureMaterial::QSGOpaqueTextureMaterial() : m_texture(0) , m_filtering(QSGTexture::Nearest) - , m_mipmap_filtering(QSGTexture::Nearest) + , m_mipmap_filtering(QSGTexture::None) , m_horizontal_wrap(QSGTexture::ClampToEdge) , m_vertical_wrap(QSGTexture::ClampToEdge) { |