diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-05-14 14:07:15 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-05-14 14:07:15 +0200 |
commit | 3ed33ec74b70bbac016dd080889bb3df3a78d90c (patch) | |
tree | a7dfaa6a921e43435757a629c6e2a86a721b1460 /src | |
parent | 8279fb44cba551e139f307217da24d3f26a86c2e (diff) | |
parent | 5a3d9309ec018445a3471d40366f41ee2f6ebef7 (diff) |
Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I1f653fa9586e7d1e9c23acffba4512cfe9f951b8
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4dataview.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqml.h | 3 | ||||
-rw-r--r-- | src/qmltyperegistrar/qmltypes.prf | 26 | ||||
-rw-r--r-- | src/quick/items/qquickevents.cpp | 8 | ||||
-rw-r--r-- | src/quick/items/qquickitemviewfxitem_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickrepeater.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrhisupport.cpp | 15 |
7 files changed, 47 insertions, 15 deletions
diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp index 5ab8cf2dcb..da1b91e69a 100644 --- a/src/qml/jsruntime/qv4dataview.cpp +++ b/src/qml/jsruntime/qv4dataview.cpp @@ -92,7 +92,7 @@ ReturnedValue DataViewCtor::virtualCallAsConstructor(const FunctionObject *f, co uint byteLength = (argc < 3 || argv[2].isUndefined()) ? (bufferLength - offset) : ::toIndex(scope.engine, argv[2]); if (scope.hasException()) return Encode::undefined(); - if (offset + byteLength > bufferLength) + if (offset > bufferLength || byteLength > bufferLength - offset) return scope.engine->throwRangeError(QStringLiteral("DataView: constructor arguments out of range")); Scoped<DataView> a(scope, scope.engine->memoryManager->allocate<DataView>()); diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index 1621e3c02e..5ea1d17478 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -760,8 +760,7 @@ inline int qmlRegisterSingletonType(const char *uri, int versionMajor, int versi } #ifdef Q_QDOC -int qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor, - const char *typeName, QObject *cppObject) +int qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor, const char *typeName, QObject *cppObject) #else template<typename T> inline auto qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor, diff --git a/src/qmltyperegistrar/qmltypes.prf b/src/qmltyperegistrar/qmltypes.prf index 0d5a6ded24..4b112351ec 100644 --- a/src/qmltyperegistrar/qmltypes.prf +++ b/src/qmltyperegistrar/qmltypes.prf @@ -85,13 +85,25 @@ qmltyperegistrar_qmltypes.CONFIG = no_link qmltyperegistrar_qmltypes.commands = $$escape_expand(\\n) # force creation of rule install_qmltypes { - isEmpty(QMLTYPES_INSTALL_DIR): \ - QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/$$TARGETPATH - do_install_qmltypes.files = $$OUT_PWD/$$QMLTYPES_FILENAME - do_install_qmltypes.path = $$QMLTYPES_INSTALL_DIR - do_install_qmltypes.CONFIG += no_check_exist - prefix_build: INSTALLS += do_install_qmltypes - else: COPIES += do_install_qmltypes + INSTALL_QML_FILES = false + + android { + build_pass { + isEmpty(ANDROID_ABIS): ANDROID_ABIS = $$ALL_ANDROID_ABIS + ABI = $$first(ANDROID_ABIS) + equals(ABI, $$QT_ARCH): INSTALL_QML_FILES = true + } + } else: !debug_and_release|!build_all|CONFIG(release, debug|release): INSTALL_QML_FILES = true + + equals(INSTALL_QML_FILES, true) { + isEmpty(QMLTYPES_INSTALL_DIR): \ + QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/$$TARGETPATH + do_install_qmltypes.files = $$OUT_PWD/$$QMLTYPES_FILENAME + do_install_qmltypes.path = $$QMLTYPES_INSTALL_DIR + do_install_qmltypes.CONFIG += no_check_exist + prefix_build: INSTALLS += do_install_qmltypes + else: COPIES += do_install_qmltypes + } } QMAKE_EXTRA_COMPILERS += qmltyperegistrar_compiler qmltyperegistrar_qmltypes diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index eddd15c6da..950afaed52 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -1744,6 +1744,8 @@ bool QQuickSinglePointEvent::hasExclusiveGrabber(const QQuickPointerHandler *han bool QQuickPointerMouseEvent::isPressEvent() const { + if (!m_event) + return false; auto me = static_cast<QMouseEvent*>(m_event); return ((me->type() == QEvent::MouseButtonPress || me->type() == QEvent::MouseButtonDblClick) && (me->buttons() & me->button()) == me->buttons()); @@ -1751,18 +1753,24 @@ bool QQuickPointerMouseEvent::isPressEvent() const bool QQuickPointerMouseEvent::isDoubleClickEvent() const { + if (!m_event) + return false; auto me = static_cast<QMouseEvent*>(m_event); return (me->type() == QEvent::MouseButtonDblClick); } bool QQuickPointerMouseEvent::isUpdateEvent() const { + if (!m_event) + return false; auto me = static_cast<QMouseEvent*>(m_event); return me->type() == QEvent::MouseMove; } bool QQuickPointerMouseEvent::isReleaseEvent() const { + if (!m_event) + return false; auto me = static_cast<QMouseEvent*>(m_event); return me && me->type() == QEvent::MouseButtonRelease; } diff --git a/src/quick/items/qquickitemviewfxitem_p_p.h b/src/quick/items/qquickitemviewfxitem_p_p.h index 3985630cda..9f22d7cedb 100644 --- a/src/quick/items/qquickitemviewfxitem_p_p.h +++ b/src/quick/items/qquickitemviewfxitem_p_p.h @@ -60,7 +60,7 @@ QT_REQUIRE_CONFIG(quick_itemview); QT_BEGIN_NAMESPACE -class Q_AUTOTEST_EXPORT QQuickItemViewFxItem +class Q_QUICK_PRIVATE_EXPORT QQuickItemViewFxItem { public: QQuickItemViewFxItem(QQuickItem *item, bool ownItem, QQuickItemChangeListener *changeListener); diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp index 20603720c5..6dc735d20b 100644 --- a/src/quick/items/qquickrepeater.cpp +++ b/src/quick/items/qquickrepeater.cpp @@ -417,6 +417,12 @@ void QQuickRepeater::createdItem(int index, QObject *) void QQuickRepeater::initItem(int index, QObject *object) { Q_D(QQuickRepeater); + if (index >= d->deletables.size()) { + // this can happen when Package is used + // calling regenerate does too much work, all we need is to call resize + // so that d->deletables[index] = item below works + d->deletables.resize(d->model->count() + 1); + } QQuickItem *item = qmlobject_cast<QQuickItem*>(object); if (!d->deletables.at(index)) { diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index 7cf4df2aa3..0df19c247f 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -391,12 +391,13 @@ static const void *qsgrhi_mtl_rifResource(QSGRendererInterface::Resource res, co const void *QSGRhiSupport::rifResource(QSGRendererInterface::Resource res, const QSGDefaultRenderContext *rc) { +// ### This condition is a temporary workaround to allow compilation +// with -no-opengl, but Vulkan or Metal enabled, to succeed. Full +// support for RHI-capable -no-opengl builds will be available in +// Qt 6 once the direct OpenGL code path gets removed. #if QT_CONFIG(opengl) + QRhi *rhi = rc->rhi(); -#else - Q_UNUSED(rc) - QRhi *rhi = nullptr; -#endif if (res == QSGRendererInterface::RhiResource || !rhi) return rhi; @@ -433,6 +434,12 @@ const void *QSGRhiSupport::rifResource(QSGRendererInterface::Resource res, default: return nullptr; } + +#else + Q_UNUSED(res); + Q_UNUSED(rc); + return nullptr; +#endif } int QSGRhiSupport::chooseSampleCountForWindowWithRhi(QWindow *window, QRhi *rhi) |