aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2020-05-15 09:01:29 +0200
committerLiang Qi <liang.qi@qt.io>2020-05-15 09:01:29 +0200
commit0ae26f8c574411cbab748128a317cc08dafe2382 (patch)
tree41437d5d0ff7cc714ff37be23b25ca7ce6b792a6 /src
parentd4042c8cd82b35b3ec67c4309d80c9c92f55d889 (diff)
parent3ed33ec74b70bbac016dd080889bb3df3a78d90c (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: If1868d27ea40fdc206971c2f7a24e91c5e62b1bf
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4dataview.cpp2
-rw-r--r--src/qml/qml/qqml.h3
-rw-r--r--src/qmltyperegistrar/qmltypes.prf26
-rw-r--r--src/quick/items/qquickevents.cpp8
-rw-r--r--src/quick/items/qquickitemviewfxitem_p_p.h2
-rw-r--r--src/quick/scenegraph/qsgrhisupport.cpp15
6 files changed, 41 insertions, 15 deletions
diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp
index bb1acb963e..264057e162 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 4957c12036..9c896e6322 100644
--- a/src/qml/qml/qqml.h
+++ b/src/qml/qml/qqml.h
@@ -746,8 +746,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 22b8877b9f..e491369d44 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -1759,6 +1759,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());
@@ -1766,18 +1768,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/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp
index ffc07a2791..b86667a972 100644
--- a/src/quick/scenegraph/qsgrhisupport.cpp
+++ b/src/quick/scenegraph/qsgrhisupport.cpp
@@ -438,12 +438,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;
@@ -480,6 +481,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)