From 342f18c71f51227a062bd204037541ecae150846 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Oct 2016 12:58:02 +0200 Subject: Check qgl_current_fbo_invalid before using qgl_current_fbo QSG24BitTextMaskShader::useSRGB() on macOS accesses the current context qgl_current_fbo member without first checking if it is valid. Make sure it also checks qgl_current_fbo_invalid, thus not accidentally dereferencing a dangling pointer. Change-Id: I56a77de23ee3b4b271bd848506ff26e14d7b6d15 Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 3eba29ba41..5ef5c79416 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -233,7 +233,8 @@ bool QSG24BitTextMaskShader::useSRGB() const // m_useSRGB is true, but if some QOGLFBO was bound check it's texture format: QOpenGLContext *ctx = QOpenGLContext::currentContext(); QOpenGLFramebufferObject *qfbo = QOpenGLContextPrivate::get(ctx)->qgl_current_fbo; - return !qfbo || qfbo->format().internalTextureFormat() == GL_SRGB8_ALPHA8_EXT; + bool fboInvalid = QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid; + return !qfbo || fboInvalid || qfbo->format().internalTextureFormat() == GL_SRGB8_ALPHA8_EXT; #else return m_useSRGB; #endif -- cgit v1.2.3 From 67e5fe1675b459de9a688be2509a060e8ccecc9e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sat, 1 Oct 2016 01:44:59 +0200 Subject: Remove superfluous warning statement in QAccessibleQuickItem::rect() The warning statement is printed whenever a successful hit test (essentialy a hover) happens on a QML item which is accessible (e.g. a Label) and also not visible. The message looks like "QQuickText QVariant(Invalid) QRect(0,0 0x0)". The information serves no real purpose though: 1) The property accessibleText is not set anywhere 2) The warning happens in a valid use case when an item is invisible, and the user mouse accidentally hovers over its position Change-Id: I8d20f7842d92c7944bb5e3b614ecd6fad500102a Reviewed-by: Frederik Gladhorn --- src/quick/accessible/qaccessiblequickitem.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp index 2ce914c0b6..df99d43531 100644 --- a/src/quick/accessible/qaccessiblequickitem.cpp +++ b/src/quick/accessible/qaccessiblequickitem.cpp @@ -61,10 +61,6 @@ int QAccessibleQuickItem::childCount() const QRect QAccessibleQuickItem::rect() const { const QRect r = itemScreenRect(item()); - - if (!r.isValid()) { - qWarning() << item()->metaObject()->className() << item()->property("accessibleText") << r; - } return r; } -- cgit v1.2.3 From 6d732026a518741718528052656a513761451b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 14 Oct 2016 12:05:08 +0100 Subject: Fix docs about ownership when QObject has a parent If you return a QObject with parent from a Q_INVOKABLE it *does* get QQmlEngine::JavaScriptOwnership. It just doesn't get deleted by JavaScript (until you unset it's parent). Change-Id: Id56debe06253ea1dd31dee844f5047d4ac055024 Reviewed-by: Simon Hausmann --- src/qml/doc/src/cppintegration/data.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc index ff30bffa83..1b75f6d14e 100644 --- a/src/qml/doc/src/cppintegration/data.qdoc +++ b/src/qml/doc/src/cppintegration/data.qdoc @@ -52,8 +52,8 @@ remain with C++ by invoking QQmlEngine::setObjectOwnership() with QQmlEngine::CppOwnership specified. Additionally, the QML engine respects the normal QObject parent ownership -semantics of Qt C++ objects, and will not ever take ownership of a QObject -instance which already has a parent. +semantics of Qt C++ objects, and will never delete a QObject instance which +has a parent. \section1 Basic Qt Data Types -- cgit v1.2.3 From 654e9e6a35682d2dbd468b82a954b55fef8b6e70 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 15 Oct 2016 13:19:07 +0200 Subject: QQuickWindow: don't discard timestamps for wheel events Noticed while debugging QTBUG-56075 on XCB. QQuickFlickable did not receive timestamps for wheel events provided by XI2. This alone does not fix the flicking speed issue with high-precision trackpads, but is needed to be able to calculate the appropriate velocity. Task-number: QTBUG-56075 Change-Id: I458e6302aee72863cdc1f8e8f7d99449016905a9 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickwindow.cpp | 1 + tests/auto/quick/qquickitem/tst_qquickitem.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 26d83cfdf5..7875005e2d 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1827,6 +1827,7 @@ bool QQuickWindowPrivate::deliverWheelEvent(QQuickItem *item, QWheelEvent *event if (item->contains(p)) { QWheelEvent wheel(p, p, event->pixelDelta(), event->angleDelta(), event->delta(), event->orientation(), event->buttons(), event->modifiers(), event->phase(), event->source()); + wheel.setTimestamp(event->timestamp()); wheel.accept(); q->sendEvent(item, &wheel); if (wheel.isAccepted()) { diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp index a403b3e42b..3a9b752f6c 100644 --- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp @@ -53,7 +53,7 @@ public: TestItem(QQuickItem *parent = 0) : QQuickItem(parent), focused(false), pressCount(0), releaseCount(0) , wheelCount(0), acceptIncomingTouchEvents(true) - , touchEventReached(false) {} + , touchEventReached(false), timestamp(0) {} bool focused; int pressCount; @@ -61,6 +61,7 @@ public: int wheelCount; bool acceptIncomingTouchEvents; bool touchEventReached; + ulong timestamp; protected: virtual void focusInEvent(QFocusEvent *) { Q_ASSERT(!focused); focused = true; } virtual void focusOutEvent(QFocusEvent *) { Q_ASSERT(focused); focused = false; } @@ -70,7 +71,7 @@ protected: touchEventReached = true; event->setAccepted(acceptIncomingTouchEvents); } - virtual void wheelEvent(QWheelEvent *event) { event->accept(); ++wheelCount; } + virtual void wheelEvent(QWheelEvent *event) { event->accept(); ++wheelCount; timestamp = event->timestamp(); } }; class TestWindow: public QQuickWindow @@ -1435,12 +1436,14 @@ void tst_qquickitem::wheelEvent() item->setVisible(visible); QWheelEvent event(QPoint(100, 50), -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical); + event.setTimestamp(123456UL); event.setAccepted(false); QGuiApplication::sendEvent(&window, &event); if (shouldReceiveWheelEvents) { QVERIFY(event.isAccepted()); QCOMPARE(item->wheelCount, 1); + QCOMPARE(item->timestamp, 123456UL); } else { QVERIFY(!event.isAccepted()); QCOMPARE(item->wheelCount, 0); -- cgit v1.2.3 From e858dc4701912c5c4e94a99d819d3a86a6ee92b3 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 19 Oct 2016 09:27:10 +0200 Subject: Fix TextInput::selectByMouse documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I41ef6b38e74162434c397535f9d73fff80e29c78 Reviewed-by: Topi Reiniƶ --- src/quick/items/qquicktextinput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 072bfd3440..9e4b01a373 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -2206,8 +2206,8 @@ QString QQuickTextInput::displayText() const If true, the user can use the mouse to select text in some platform-specific way. Note that for some platforms this may - not be an appropriate interaction (eg. may conflict with how - the text needs to behave inside a Flickable. + not be an appropriate interaction (it may conflict with how + the text needs to behave inside a \l Flickable, for example). */ bool QQuickTextInput::selectByMouse() const { -- cgit v1.2.3 From 161473721dcdfd45e6618457a2c0a6e6b10bfada Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 22 Oct 2016 04:08:27 +0200 Subject: Add the ability to explicitly enable the code cache in qmljs This also requires mapping the label pointers in the byte code back to the instruction enum. Fortunately this reverse mapping is only needed in the qmljs case. Normally in the QML engine we persist the byte-code to disk before linking the compilation unit to the engine (where we map the enum to goto labels). Change-Id: If0b79288274bb1031161841b63a85f164502aaec Reviewed-by: Lars Knoll --- src/qml/compiler/qv4instr_moth_p.h | 1 + src/qml/compiler/qv4isel_moth.cpp | 37 +++++++++++++++++++++++++++++-- tools/qmljs/qmljs.cpp | 45 ++++++++++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 9 deletions(-) diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index b83bcdb83b..ca4e0b73d4 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -253,6 +253,7 @@ union Instr { enum Type { FOR_EACH_MOTH_INSTR(MOTH_INSTR_ENUM) + LastInstruction }; struct instr_common { diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp index cd47f22205..ca6319ef3c 100644 --- a/src/qml/compiler/qv4isel_moth.cpp +++ b/src/qml/compiler/qv4isel_moth.cpp @@ -1477,6 +1477,17 @@ bool CompilationUnit::saveCodeToDisk(QIODevice *device, const CompiledData::Unit QByteArray padding; +#ifdef MOTH_THREADED_INTERPRETER + // Map from instruction label back to instruction type. Only needed when persisting + // already linked compilation units; + QHash reverseInstructionMapping; + if (engine) { + void **instructions = VME::instructionJumpTable(); + for (int i = 0; i < Instr::LastInstruction; ++i) + reverseInstructionMapping.insert(instructions[i], i); + } +#endif + for (int i = 0; i < codeRefs.size(); ++i) { const CompiledData::Function *compiledFunction = unit->functionAt(i); @@ -1493,8 +1504,30 @@ bool CompilationUnit::saveCodeToDisk(QIODevice *device, const CompiledData::Unit return false; } - const void *codePtr = codeRefs.at(i).constData(); - written = device->write(reinterpret_cast(codePtr), compiledFunction->codeSize); + QByteArray code = codeRefs.at(i); + +#ifdef MOTH_THREADED_INTERPRETER + if (!reverseInstructionMapping.isEmpty()) { + char *codePtr = code.data(); // detaches + int index = 0; + while (index < code.size()) { + Instr *genericInstr = reinterpret_cast(codePtr + index); + + genericInstr->common.instructionType = reverseInstructionMapping.value(genericInstr->common.code); + + switch (genericInstr->common.instructionType) { + #define REVERSE_INSTRUCTION(InstructionType, Member) \ + case Instr::InstructionType: \ + index += InstrMeta<(int)Instr::InstructionType>::Size; \ + break; + + FOR_EACH_MOTH_INSTR(REVERSE_INSTRUCTION) + } + } + } +#endif + + written = device->write(code.constData(), compiledFunction->codeSize); if (written != qint64(compiledFunction->codeSize)) { *errorString = device->errorString(); return false; diff --git a/tools/qmljs/qmljs.cpp b/tools/qmljs/qmljs.cpp index b4ffc9be16..4b63357363 100644 --- a/tools/qmljs/qmljs.cpp +++ b/tools/qmljs/qmljs.cpp @@ -51,6 +51,8 @@ QT_REQUIRE_CONFIG(qml_interpreter); #include #include +#include +#include #include #include #include @@ -147,6 +149,7 @@ int main(int argc, char *argv[]) #endif bool runAsQml = false; + bool cache = false; if (!args.isEmpty()) { if (args.first() == QLatin1String("--jit")) { @@ -166,6 +169,11 @@ int main(int argc, char *argv[]) args.removeFirst(); } + if (args.first() == QLatin1String("--cache")) { + cache = true; + args.removeFirst(); + } + if (args.first() == QLatin1String("--help")) { std::cerr << "Usage: qmljs [|--jit|--interpret|--qml] file..." << std::endl; return EXIT_SUCCESS; @@ -199,15 +207,38 @@ int main(int argc, char *argv[]) for (const QString &fn : qAsConst(args)) { QFile file(fn); if (file.open(QFile::ReadOnly)) { - const QString code = QString::fromUtf8(file.readAll()); - file.close(); + QScopedPointer script; + if (cache && QFile::exists(fn + QLatin1Char('c'))) { + QQmlRefPointer unit = iSelFactory->createUnitForLoading(); + QString error; + if (unit->loadFromDisk(QUrl::fromLocalFile(fn), iSelFactory, &error)) { + script.reset(new QV4::Script(&vm, nullptr, unit)); + } else { + std::cout << "Error loading" << qPrintable(fn) << "from disk cache:" << qPrintable(error) << std::endl; + } + } + if (!script) { + const QString code = QString::fromUtf8(file.readAll()); + file.close(); + script.reset(new QV4::Script(ctx, code, fn)); + script->parseAsBinding = runAsQml; + script->parse(); + } QV4::ScopedValue result(scope); - QV4::Script script(ctx, code, fn); - script.parseAsBinding = runAsQml; - script.parse(); - if (!scope.engine->hasException) - result = script.run(); + if (!scope.engine->hasException) { + const auto unit = script->compilationUnit; + if (cache && unit && !(unit->data->flags & QV4::CompiledData::Unit::StaticData)) { + if (unit->data->sourceTimeStamp == 0) { + const_cast(unit->data)->sourceTimeStamp = QFileInfo(fn).lastModified().toMSecsSinceEpoch(); + } + QString saveError; + if (!unit->saveToDisk(QUrl::fromLocalFile(fn), &saveError)) { + std::cout << "Error saving JS cache file: " << qPrintable(saveError) << std::endl; + } + } + result = script->run(); + } if (scope.engine->hasException) { QV4::StackTrace trace; QV4::ScopedValue ex(scope, scope.engine->catchException(&trace)); -- cgit v1.2.3 From 20bfb6a7d60f03c44e1ad25438ea1f78d59717ff Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 20 Oct 2016 21:57:28 +0200 Subject: tst_qquicktext: remove bogus blacklisting There's no such test as mouseSelection in tst_qquicktext. Change-Id: I09bf4c61b53acd9811e020379a29c80fce9fe48b Reviewed-by: Frederik Gladhorn --- tests/auto/quick/qquicktext/BLACKLIST | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/quick/qquicktext/BLACKLIST b/tests/auto/quick/qquicktext/BLACKLIST index 0c65f1e245..2e4349a310 100644 --- a/tests/auto/quick/qquicktext/BLACKLIST +++ b/tests/auto/quick/qquicktext/BLACKLIST @@ -1,4 +1,2 @@ [dependentImplicitSizes] * -[mouseSelection] -* -- cgit v1.2.3 From bb8ae2d0a0ff9f36ffaf4ba64b03bd2160c99cd2 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 21 Oct 2016 13:58:58 +0200 Subject: tst_qquicktextedit: remove mouseDoubleClickInterval wait Since qtbase commit beef975, QTestLib avoids generating accidental double click events by adding 500ms timestamp delta on release events. Thus, now we can remove the QStyleHints::mouseDoubleClickInterval wait, which were there to prevent the aforementioned accidental double click events that can no longer happen. The default inverval is 400ms, so this saves us nearly half a second on most platforms. Change-Id: I7a670b70c012ac027dc951ebafdf5e7d53b89ce9 Reviewed-by: Friedemann Kleint --- tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index 7f454aaa11..580c25b225 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -2963,9 +2963,6 @@ void tst_qquicktextedit::middleClickPaste() // Middle click pastes the selected text, assuming the platform supports it. QTest::mouseClick(&window, Qt::MiddleButton, Qt::NoModifier, p3); - // ### This is to prevent double click detection from carrying over to the next test. - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); - if (QGuiApplication::clipboard()->supportsSelection()) QCOMPARE(textEditObject->text().mid(1, selectedText.length()), selectedText); else -- cgit v1.2.3 From a754b0620f3f153b93f30ab28cf184cdfd11d005 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Sep 2016 16:05:52 -0700 Subject: Cast enums to int before streaming into QDataStream They are decoded as ints, as in QPacket &operator>>(QPacket &ds, QmlObjectProperty &data) { int type; ds >> type >> data.name >> data.value >> data.valueTypeName >> data.binding >> data.hasNotifySignal; data.type = (QmlObjectProperty::Type)type; return ds; } So we should serialize the same, since the required operator<< and >> don't exist. Change-Id: I33dc971f005a4848bb8ffffd1478edcf2e916dfc Reviewed-by: Ulf Hermann --- .../qmltooling/qmldbg_debugger/qdebugmessageservice.cpp | 2 +- src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp | 2 +- src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp index 31873f7915..b0f59717ac 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp @@ -70,7 +70,7 @@ void QDebugMessageServiceImpl::sendDebugMessage(QtMsgType type, //We just eavesdrop and forward the messages to a port //only if a client is connected to it. QQmlDebugPacket ws; - ws << QByteArray("MESSAGE") << type << buf.toUtf8(); + ws << QByteArray("MESSAGE") << int(type) << buf.toUtf8(); ws << QByteArray(ctxt.file) << ctxt.line << QByteArray(ctxt.function); ws << QByteArray(ctxt.category) << timer.nsecsElapsed(); diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp index a4320098c0..90e817e2fc 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp @@ -101,7 +101,7 @@ static void qQmlProfilerDataToByteArrays(const QQmlProfilerData &d, ds << static_cast(d.locationId); messages.append(ds.squeezedData()); ds.clear(); - ds << d.time << QQmlProfilerDefinitions::RangeData + ds << d.time << int(QQmlProfilerDefinitions::RangeData) << static_cast(d.detailType) << (i->location.sourceFile.isEmpty() ? i->url.toString() : i->location.sourceFile); diff --git a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp index eee1dd7eae..eae5e0a795 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp @@ -76,7 +76,7 @@ qint64 QV4ProfilerAdapter::appendMemoryEvents(qint64 until, QList &m while (memoryData.length() > m_memoryPos && memoryData[m_memoryPos].timestamp <= until) { const QV4::Profiling::MemoryAllocationProperties &props = memoryData[m_memoryPos]; - d << props.timestamp << MemoryAllocation << props.type << props.size; + d << props.timestamp << int(MemoryAllocation) << int(props.type) << props.size; ++m_memoryPos; messages.append(d.squeezedData()); d.clear(); @@ -120,7 +120,7 @@ qint64 QV4ProfilerAdapter::sendMessages(qint64 until, QList &message return finalizeMessages(until, messages, m_stack.top(), d); appendMemoryEvents(m_stack.top(), messages, d); - d << m_stack.pop() << RangeEnd << Javascript; + d << m_stack.pop() << int(RangeEnd) << int(Javascript); messages.append(d.squeezedData()); d.clear(); } @@ -134,19 +134,19 @@ qint64 QV4ProfilerAdapter::sendMessages(qint64 until, QList &message appendMemoryEvents(props.start, messages, d); auto location = m_functionLocations.find(props.id); - d << props.start << RangeStart << Javascript; + d << props.start << int(RangeStart) << int(Javascript); if (trackLocations) d << static_cast(props.id); if (location != m_functionLocations.end()) { messages.push_back(d.squeezedData()); d.clear(); - d << props.start << RangeLocation << Javascript << location->file << location->line + d << props.start << int(RangeLocation) << int(Javascript) << location->file << location->line << location->column; if (trackLocations) d << static_cast(props.id); messages.push_back(d.squeezedData()); d.clear(); - d << props.start << RangeData << Javascript << location->name; + d << props.start << int(RangeData) << int(Javascript) << location->name; if (trackLocations) { d << static_cast(props.id); -- cgit v1.2.3 From 55b9c7c1bdc7ccaf3126622e72843a3c247cbaf4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 20 Oct 2016 21:38:30 +0200 Subject: Make tst_qquicktextedit::mouseSelection() pass Since qtbase commit beef975, QTestLib avoids generating accidental double click events by adding 500ms timestamp delta on release events. The test requires a press-and-drag-and-release type of sequence with double and triple clicks. The triple-click case is handled fine with QTest::mouseDClick() + press + move + release, but the double-click case is using QTest::mouseClick() + press + move + release and relies on the accidental double-click event generation that QTestLib now deliberately prevents. I can't think of a nice way to inject the move event in the middle of a double-click sequence generated by QTest::mouseDClick(), so we just send the missing double-click event by hand. We can also remove the QStyleHints::mouseDoubleClickInterval waits, which were there to prevent the aforementioned accidental double click events that can no longer happen. This reduces the total execution time of mouseSelection() by roughly 90%. Task-number: QTBUG-50022 Change-Id: I252e87d6a49ea86a44cfa347a29eebee12fd36d1 Reviewed-by: Mitch Curtis Reviewed-by: Frederik Gladhorn --- tests/auto/quick/qquicktextedit/BLACKLIST | 2 -- tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp | 13 ++++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 tests/auto/quick/qquicktextedit/BLACKLIST diff --git a/tests/auto/quick/qquicktextedit/BLACKLIST b/tests/auto/quick/qquicktextedit/BLACKLIST deleted file mode 100644 index 492d81531a..0000000000 --- a/tests/auto/quick/qquicktextedit/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -[mouseSelection] -* diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index 580c25b225..d007e7c98d 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -2006,12 +2006,18 @@ void tst_qquicktextedit::mouseSelection() else if (clicks == 3) QTest::mouseDClick(&window, Qt::LeftButton, Qt::NoModifier, p1); QTest::mousePress(&window, Qt::LeftButton, Qt::NoModifier, p1); + if (clicks == 2) { + // QTBUG-50022: Since qtbase commit beef975, QTestLib avoids generating + // double click events by adding 500ms delta to release event timestamps. + // Send a double click event by hand to ensure the correct sequence: + // press, release, press, _dbl click_, move, release. + QMouseEvent dblClickEvent(QEvent::MouseButtonDblClick, p1, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QGuiApplication::sendEvent(textEditObject, &dblClickEvent); + } QTest::mouseMove(&window, p2); QTest::mouseRelease(&window, Qt::LeftButton, Qt::NoModifier, p2); QTRY_COMPARE(textEditObject->selectedText(), selectedText); - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); - // Clicking and shift to clicking between the same points should select the same text. textEditObject->setCursorPosition(0); if (clicks > 1) @@ -2020,9 +2026,6 @@ void tst_qquicktextedit::mouseSelection() QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, p1); QTest::mouseClick(&window, Qt::LeftButton, Qt::ShiftModifier, p2); QTRY_COMPARE(textEditObject->selectedText(), selectedText); - - // ### This is to prevent double click detection from carrying over to the next test. - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); } void tst_qquicktextedit::dragMouseSelection() -- cgit v1.2.3 From ebff8e53c7c6c4fcbc7fc7e33709b64ec124e119 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 24 Oct 2016 10:11:37 +0300 Subject: d3d12 plugin depends on quick d3d12 config is not available if quick module has not been built. Fix Project ERROR: Could not find feature d3d12. Change-Id: If6707a6e4ef9d9996f30746b0f3372a4b5bfbb04 Reviewed-by: Laszlo Agocs --- src/plugins/plugins.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 11c8641e21..2467239be2 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs !contains(QT_CONFIG, no-qml-debug):SUBDIRS += qmltooling -SUBDIRS += scenegraph +qtHaveModule(quick):SUBDIRS += scenegraph -- cgit v1.2.3 From 9f6ae7fce68d1592b71be7df7ebfffade60ef737 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 21 Oct 2016 18:38:50 +0200 Subject: Fix QML Compiler crash After commit 2afb54fb51091765f79548b0b057795bc3c6eb38, Primitive::undefinedValue() uses setM() to clear out all bits. Previously that code was #ifndef'ed out for the bootstrap build, but now that we can do the correct boxing in host builds (as we know the pointer size), we can re-enable setM() in bootstrap builds and fix this crash that was a Q_UNREACHABLE() assertion. Change-Id: I49036792c06c9a17272aba65261ab8f32beb2ad8 Task-number: QTBUG-56658 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4value_p.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 13339129eb..5b6688f6b4 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -169,10 +169,7 @@ public: Q_ALWAYS_INLINE quint32 value() const { return _val & quint64(~quint32(0)); } Q_ALWAYS_INLINE quint32 tag() const { return _val >> 32; } -#if defined(V4_BOOTSTRAP) - Q_ALWAYS_INLINE Heap::Base *m() const { Q_UNREACHABLE(); return Q_NULLPTR; } - Q_ALWAYS_INLINE void setM(Heap::Base *b) { Q_UNUSED(b); Q_UNREACHABLE(); } -#elif defined(QV4_USE_64_BIT_VALUE_ENCODING) +#if defined(QV4_USE_64_BIT_VALUE_ENCODING) Q_ALWAYS_INLINE Heap::Base *m() const { Heap::Base *b; -- cgit v1.2.3 From 708bb28c98721e83f8b5c12a2e0653834a68de23 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 22 Oct 2016 02:09:46 +0200 Subject: Fix crash when loop peeling and basic block merging When trying to merge the second (original) loop header block of a peeled loop, we would end up with dangling references to that block from the loop body blocks. There's no trivial way to find all these quickly from the header, so for now don't merge these blocks into the predecessor. Change-Id: I2b5e39c5596ffd8c21ca9871af3a8150a019f2a8 Reviewed-by: Erik Verbruggen --- src/qml/compiler/qv4ssa.cpp | 4 ++++ tests/auto/qml/qjsengine/tst_qjsengine.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index e4eaeaa3f6..4111cc77db 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -5075,6 +5075,10 @@ void mergeBasicBlocks(IR::Function *function, DefUses *du, DominatorTree *dt) BasicBlock *successor = bb->out.first(); if (successor->in.size() != 1) continue; // more than one incoming edge + // Loop header? No efficient way to update the other blocks that refer to this as containing group, + // so don't do merging yet. + if (successor->isGroupStart()) continue; + // Ok, we can merge the two basic blocks. if (DebugBlockMerging) { qDebug("Merging L%d into L%d", successor->index(), bb->index()); diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index d95d4ed59e..c20f0888d8 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -194,6 +194,8 @@ private slots: void withNoContext(); void holeInPropertyData(); + void basicBlockMergeAfterLoopPeeling(); + signals: void testSignal(); }; @@ -4044,6 +4046,22 @@ void tst_QJSEngine::holeInPropertyData() QVERIFY(ok.toBool()); } +void tst_QJSEngine::basicBlockMergeAfterLoopPeeling() +{ + QJSEngine engine; + QJSValue ok = engine.evaluate( + "function crashMe() {\n" + " var seen = false;\n" + " while (globalVar) {\n" + " if (seen)\n" + " return;\n" + " seen = true;\n" + " }\n" + "}\n"); + QVERIFY(!ok.isCallable()); + +} + QTEST_MAIN(tst_QJSEngine) #include "tst_qjsengine.moc" -- cgit v1.2.3 From 52599c3cca35be20b53d0de6604743061c3e1c8c Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 14 Oct 2016 12:07:47 +0200 Subject: QML: Hint LTO to never inline QQmlPropertyCache::resolve ... so the fast-path doesn't get bogged down by accidental slow-path inlining. Change-Id: Ifb3eadf5e96b5a61f41fb1f0d32269e43f13be57 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlpropertycache_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 18ae32ebf9..6281b9c05e 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -468,7 +468,7 @@ private: QQmlPropertyData *ensureResolved(QQmlPropertyData*) const; - void resolve(QQmlPropertyData *) const; + Q_NEVER_INLINE void resolve(QQmlPropertyData *) const; void updateRecur(const QMetaObject *); template @@ -677,7 +677,7 @@ bool QQmlPropertyData::operator==(const QQmlPropertyRawData &other) inline QQmlPropertyData *QQmlPropertyCache::ensureResolved(QQmlPropertyData *p) const { - if (p && p->notFullyResolved()) + if (p && Q_UNLIKELY(p->notFullyResolved())) resolve(p); return p; -- cgit v1.2.3 From ffedab7ba0ecc816ebf5d80d1414d1972e61029b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 21 Oct 2016 10:26:18 +0200 Subject: Add a test for bitmap font rendering in Qt Quick The "fixedsys" font is available on Windows at least, so while this test may not add any value on other platforms, it won't hurt either, and this was something that regressed on Windows before. Task-number: QTBUG-56659 Change-Id: Id01dedcbdc2fe74027caf31dd0dde6729ade8c63 Reviewed-by: Eirik Aavitsland --- .../scenegraph_lancelot/data/text/text_bitmapfont.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/manual/scenegraph_lancelot/data/text/text_bitmapfont.qml diff --git a/tests/manual/scenegraph_lancelot/data/text/text_bitmapfont.qml b/tests/manual/scenegraph_lancelot/data/text/text_bitmapfont.qml new file mode 100644 index 0000000000..d1a289e24f --- /dev/null +++ b/tests/manual/scenegraph_lancelot/data/text/text_bitmapfont.qml @@ -0,0 +1,18 @@ +// test use of Fixedsys font on Windows + +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + Text { + anchors.fill: parent + wrapMode: Text.Wrap + font.family: "Fixedsys" + font.pixelSize: 20 + text: "Foobar" + } +} + + -- cgit v1.2.3 From 210a4584b87add2061f805ae50eb5079eec48cf5 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Tue, 25 Oct 2016 09:23:56 -0400 Subject: Change Import::type from quint8 to LEUInt32 Import::type used to be a quint32. The switch from quint32 to quint8 changed the alignment of other structures in the compiled blob. On QNX, the alignment isn't appropriate for some of the instructions that the compiler uses to access/modify the structures and a BUS error occurs. Changing Import::type to LEUInt32 puts the alignment back the way it was before. Simpler than trying to figure out how to get everything aligned correctly with a quint8 at the front of the structure. Task-number: QTBUG-56341 Change-Id: Ia6f4daff5f615f9c5dbcc34ce8c3c9a89bab2b69 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compileddata_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 8f68131ced..90cbe04505 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE // Bump this whenever the compiler data structures change in an incompatible way. -#define QV4_DATA_STRUCTURE_VERSION 0x06 +#define QV4_DATA_STRUCTURE_VERSION 0x07 class QIODevice; class QQmlPropertyCache; @@ -587,7 +587,7 @@ struct Import ImportFile = 0x2, ImportScript = 0x3 }; - quint8 type; + LEUInt32 type; LEUInt32 uriIndex; LEUInt32 qualifierIndex; -- cgit v1.2.3 From c849f3a7eff55d60c4010831ec67336c5c0f2a27 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 26 Oct 2016 08:21:00 +0200 Subject: Fix documentation for dragFinished signal Change-Id: I9a38ab8ff60921e6d5ff6c2fa476b24d28781feb Reviewed-by: Venugopal Shivashankar --- src/quick/items/qquickdrag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index 71217ce146..d3c7adf2ba 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -701,7 +701,7 @@ void QQuickDragAttached::cancel() */ /*! - \qmlattachedsignal QtQuick::Drag::dragFinished(DropAction action) + \qmlattachedsignal QtQuick::Drag::dragFinished(DropAction dropAction) This signal is emitted when a drag finishes and the drag was started with the \l startDrag() method or started automatically using the \l dragType property. -- cgit v1.2.3 From 621c5b2b260d63fef7190c133f7384b8ccb93307 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 18 Oct 2016 14:07:20 +0200 Subject: Doc: better example explaining use of tx.executeSql with parameters Change-Id: I79ab2cc4c0525dbc285b04b3867220f6943dc9e6 Reviewed-by: Venugopal Shivashankar --- .../doc/snippets/qml/localstorage/dbtransaction.js | 31 +++++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/quick/doc/snippets/qml/localstorage/dbtransaction.js b/src/quick/doc/snippets/qml/localstorage/dbtransaction.js index 07d8a5618b..40eb6d2804 100644 --- a/src/quick/doc/snippets/qml/localstorage/dbtransaction.js +++ b/src/quick/doc/snippets/qml/localstorage/dbtransaction.js @@ -39,30 +39,47 @@ ****************************************************************************/ //![0] +var db = LocalStorage.openDatabaseSync("ActivityTrackDB", "", "Database tracking sports activities", 1000000); db.transaction( try { function(tx) { - tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); + tx.executeSql('INSERT INTO trip_log VALUES(?, ?, ?)', + [ '01/10/2016','Sylling - Vikersund', '53' ]); } } catch (err) { - console.log("Error inserting into table Greeting"); + console.log("Error inserting into table Greeting: " + err); } ) //![0] //![1] +// Retrieve activity date, description and distance based on minimum +// distance parameter Pdistance +function db_distance_select(Pdistance) +{ +var db = LocalStorage.openDatabaseSync("ActivityTrackDB", "", "Database tracking sports activities", 1000000); db.transaction( function(tx) { - var results = tx.executeSql('SELECT salutation FROM Greeting WHERE salutee=?;', 'world'); + var results = tx.executeSql('SELECT rowid, + date, + trip_desc, + distance FROM trip_log + where distance >= ?',[Pdistance]'); + for (var i = 0; i < results.rows.length; i++) { + listModel.append({"id": results.rows.item(i).rowid, + "date": results.rows.item(i).date, + "trip_desc": results.rows.item(i).trip_desc, + "distance": results.rows.item(i).distance}); + } } - console.log("We greeted in this most respectful way: " + results.rows.item(0).value); -) +} //![1] //![2] -var db = LocalStorage.openDatabaseSync("QQmlExampleDB", "", "The Example QML SQL!", 1000000); +var db = LocalStorage.openDatabaseSync("ActivityTrackDB", "", "Database tracking sports activities", 1000000); if (db.version == '0.1') { db.changeVersion('0.1', '0.2', function(tx) { - tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); + tx.executeSql('INSERT INTO trip_log VALUES(?, ?, ?)', + [ '01/10/2016','Sylling - Vikersund', '53' ]); } }); //![2] -- cgit v1.2.3 From 93d7c26653757755ae65f14d06d6df6f9ec2fc07 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 16 Oct 2016 19:21:29 +0200 Subject: QQuickShortcut: allow setting a custom context matcher This allows Qt Quick Controls 2 to register a shortcut context matcher that makes shortcuts behave well with QQC2's item-based popups, which QQuickShortcut is not aware of. Task-number: QTBUG-56562 Change-Id: Ia2518fd6ac7140f60aa38c7d9af557007e9db23b Reviewed-by: Mitch Curtis Reviewed-by: Qt CI Bot --- src/quick/util/qquickshortcut.cpp | 55 ++++++++++++------- .../quick/qquickshortcut/tst_qquickshortcut.cpp | 64 ++++++++++++++++++++++ 2 files changed, 99 insertions(+), 20 deletions(-) diff --git a/src/quick/util/qquickshortcut.cpp b/src/quick/util/qquickshortcut.cpp index 9725ddd671..3e04161639 100644 --- a/src/quick/util/qquickshortcut.cpp +++ b/src/quick/util/qquickshortcut.cpp @@ -41,10 +41,9 @@ #include #include +#include #include -QT_BEGIN_NAMESPACE - /*! \qmltype Shortcut \instantiates QQuickShortcut @@ -89,6 +88,39 @@ QT_BEGIN_NAMESPACE The corresponding handler is \c onActivatedAmbiguously. */ +static bool qQuickShortcutContextMatcher(QObject *obj, Qt::ShortcutContext context) +{ + switch (context) { + case Qt::ApplicationShortcut: + return true; + case Qt::WindowShortcut: + while (obj && !obj->isWindowType()) { + obj = obj->parent(); + if (QQuickItem *item = qobject_cast(obj)) + obj = item->window(); + } + return obj && obj == QGuiApplication::focusWindow(); + default: + return false; + } +} + +typedef bool (*ContextMatcher)(QObject *, Qt::ShortcutContext); + +Q_GLOBAL_STATIC_WITH_ARGS(ContextMatcher, ctxMatcher, (qQuickShortcutContextMatcher)) + +Q_QUICK_PRIVATE_EXPORT ContextMatcher qt_quick_shortcut_context_matcher() +{ + return *ctxMatcher(); +} + +Q_QUICK_PRIVATE_EXPORT void qt_quick_set_shortcut_context_matcher(ContextMatcher matcher) +{ + *ctxMatcher() = matcher; +} + +QT_BEGIN_NAMESPACE + QQuickShortcut::QQuickShortcut(QObject *parent) : QObject(parent), m_id(0), m_enabled(true), m_completed(false), m_autorepeat(true), m_context(Qt::WindowShortcut) { @@ -278,30 +310,13 @@ bool QQuickShortcut::event(QEvent *event) return false; } -static bool qQuickShortcutContextMatcher(QObject *obj, Qt::ShortcutContext context) -{ - switch (context) { - case Qt::ApplicationShortcut: - return true; - case Qt::WindowShortcut: - while (obj && !obj->isWindowType()) { - obj = obj->parent(); - if (QQuickItem *item = qobject_cast(obj)) - obj = item->window(); - } - return obj && obj == QGuiApplication::focusWindow(); - default: - return false; - } -} - void QQuickShortcut::grabShortcut(const QKeySequence &sequence, Qt::ShortcutContext context) { ungrabShortcut(); if (m_completed && !sequence.isEmpty()) { QGuiApplicationPrivate *pApp = QGuiApplicationPrivate::instance(); - m_id = pApp->shortcutMap.addShortcut(this, sequence, context, qQuickShortcutContextMatcher); + m_id = pApp->shortcutMap.addShortcut(this, sequence, context, *ctxMatcher()); if (!m_enabled) pApp->shortcutMap.setShortcutEnabled(false, m_id, this); if (!m_autorepeat) diff --git a/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp b/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp index 35a1aa8757..2df94bb84a 100644 --- a/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp +++ b/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp @@ -43,6 +43,8 @@ private slots: void sequence(); void context_data(); void context(); + void matcher_data(); + void matcher(); }; Q_DECLARE_METATYPE(Qt::Key) @@ -344,6 +346,68 @@ void tst_QQuickShortcut::context() || inactiveWindow->property("ambiguousShortcut").toString() == ambiguousShortcut); } +typedef bool (*ShortcutContextMatcher)(QObject *, Qt::ShortcutContext); +extern ShortcutContextMatcher qt_quick_shortcut_context_matcher(); +extern void qt_quick_set_shortcut_context_matcher(ShortcutContextMatcher matcher); + +static ShortcutContextMatcher lastMatcher = nullptr; + +static bool trueMatcher(QObject *, Qt::ShortcutContext) +{ + lastMatcher = trueMatcher; + return true; +} + +static bool falseMatcher(QObject *, Qt::ShortcutContext) +{ + lastMatcher = falseMatcher; + return false; +} + +Q_DECLARE_METATYPE(ShortcutContextMatcher) + +void tst_QQuickShortcut::matcher_data() +{ + QTest::addColumn("matcher"); + QTest::addColumn("key"); + QTest::addColumn("shortcut"); + QTest::addColumn("activatedShortcut"); + + ShortcutContextMatcher tm = trueMatcher; + ShortcutContextMatcher fm = falseMatcher; + + QTest::newRow("F1") << tm << Qt::Key_F1 << shortcutMap("F1", Qt::ApplicationShortcut) << "F1"; + QTest::newRow("F2") << fm << Qt::Key_F2 << shortcutMap("F2", Qt::ApplicationShortcut) << ""; +} + +void tst_QQuickShortcut::matcher() +{ + QFETCH(ShortcutContextMatcher, matcher); + QFETCH(Qt::Key, key); + QFETCH(QVariant, shortcut); + QFETCH(QString, activatedShortcut); + + ShortcutContextMatcher defaultMatcher = qt_quick_shortcut_context_matcher(); + QVERIFY(defaultMatcher); + + qt_quick_set_shortcut_context_matcher(matcher); + QVERIFY(qt_quick_shortcut_context_matcher() == matcher); + + QQmlApplicationEngine engine(testFileUrl("shortcuts.qml")); + QQuickWindow *window = qobject_cast(engine.rootObjects().value(0)); + QVERIFY(window); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + window->setProperty("shortcuts", QVariantList() << shortcut); + QTest::keyClick(window, key); + + QVERIFY(lastMatcher == matcher); + QCOMPARE(window->property("activatedShortcut").toString(), activatedShortcut); + + qt_quick_set_shortcut_context_matcher(defaultMatcher); +} + QTEST_MAIN(tst_QQuickShortcut) #include "tst_qquickshortcut.moc" -- cgit v1.2.3 From e0e99ebc5e27f8700bea711fc0c5d122b88447a1 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Tue, 18 Oct 2016 08:43:40 +0300 Subject: Fix build with QT_NO_LIBRARY Move #ifdef to correct place in relation to the #endif Change-Id: Id3363ad2ebbe246bc1e93e345432ef52908cf1ee Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/qsgcontextplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index 3751891455..7fab9aeae8 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -148,9 +148,9 @@ QSGAdaptationBackendData *contextFactory() } } +#ifndef QT_NO_LIBRARY // Then try the plugins. if (!backendData->factory) { -#ifndef QT_NO_LIBRARY const int index = loader()->indexOf(requestedBackend); if (index != -1) backendData->factory = qobject_cast(loader()->instance(index)); -- cgit v1.2.3 From 65e1dd24c2148bfb9a9e014dfe660c56a0756528 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 1 Nov 2016 11:15:45 +0100 Subject: Imports: Build settings depending on feature settings Fix warning: qtdeclarative/src/imports/settings/settings.pro:1: Cannot find feature qfeatures Change-Id: I215801bbadd1a07deef69bb38b0ac31b8da4d64e Reviewed-by: Lars Knoll --- src/imports/imports.pro | 3 ++- src/imports/settings/settings.pro | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/imports/imports.pro b/src/imports/imports.pro index affc1db2c0..cad02a2980 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -6,9 +6,10 @@ SUBDIRS += \ folderlistmodel \ localstorage \ models \ - settings \ statemachine +qtConfig(settings): SUBDIRS += settings + qtHaveModule(quick) { SUBDIRS += \ layouts \ diff --git a/src/imports/settings/settings.pro b/src/imports/settings/settings.pro index 3d7c9c31b8..29229f59cb 100644 --- a/src/imports/settings/settings.pro +++ b/src/imports/settings/settings.pro @@ -1,6 +1,3 @@ -load(qfeatures) -requires(!contains(QT_DISABLED_FEATURES, settings)) - CXX_MODULE = qml TARGET = qmlsettingsplugin TARGETPATH = Qt/labs/settings -- cgit v1.2.3 From ef502bd71a0d81f1428263a11c38cd7c893ac515 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 2 Nov 2016 11:44:36 +0100 Subject: Quick: allow NaN check to be inlined Change-Id: Ia4a935e1da82106954b661264e7a630befd80cc6 Reviewed-by: Robin Burchell --- src/quick/items/qquickitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index e6069d692f..efb7d46efa 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -6303,7 +6303,7 @@ QPointF QQuickItem::position() const void QQuickItem::setX(qreal v) { Q_D(QQuickItem); - if (qIsNaN(v)) + if (qt_is_nan(v)) return; if (d->x == v) return; @@ -6320,7 +6320,7 @@ void QQuickItem::setX(qreal v) void QQuickItem::setY(qreal v) { Q_D(QQuickItem); - if (qIsNaN(v)) + if (qt_is_nan(v)) return; if (d->y == v) return; -- cgit v1.2.3