diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/3rdparty/masm/yarr/YarrPattern.h | 1 | ||||
| -rw-r--r-- | src/plugins/scenegraph/openvg/qsgopenvghelpers.cpp | 8 | ||||
| -rw-r--r-- | src/qml/doc/src/javascript/number.qdoc | 2 | ||||
| -rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 2 | ||||
| -rw-r--r-- | src/qml/jsruntime/qv4internalclass_p.h | 2 | ||||
| -rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 3 | ||||
| -rw-r--r-- | src/qml/qml/qqmlimport.cpp | 2 | ||||
| -rw-r--r-- | src/qml/qml/qqmltype.cpp | 20 | ||||
| -rw-r--r-- | src/qml/qml/qqmltype_p_p.h | 3 | ||||
| -rw-r--r-- | src/qml/types/qqmlmodelsmodule.cpp | 2 | ||||
| -rw-r--r-- | src/quick/handlers/qquickdraghandler.cpp | 7 | ||||
| -rw-r--r-- | src/quick/items/qquickrectangle_p_p.h | 2 | ||||
| -rw-r--r-- | src/quick/items/qquickwindow.cpp | 4 | ||||
| -rw-r--r-- | src/quick/scenegraph/qsgdefaultcontext.cpp | 10 |
14 files changed, 39 insertions, 29 deletions
diff --git a/src/3rdparty/masm/yarr/YarrPattern.h b/src/3rdparty/masm/yarr/YarrPattern.h index 1417ff1549..10ea2c5b94 100644 --- a/src/3rdparty/masm/yarr/YarrPattern.h +++ b/src/3rdparty/masm/yarr/YarrPattern.h @@ -31,6 +31,7 @@ #include "YarrUnicodeProperties.h" #include <wtf/CheckedArithmetic.h> #include <wtf/HashMap.h> +#include <wtf/Optional.h> #include <wtf/PrintStream.h> #include <wtf/Vector.h> #include <wtf/text/WTFString.h> diff --git a/src/plugins/scenegraph/openvg/qsgopenvghelpers.cpp b/src/plugins/scenegraph/openvg/qsgopenvghelpers.cpp index 6bc99d32a1..ab5cfb48b8 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvghelpers.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvghelpers.cpp @@ -220,10 +220,10 @@ void qDrawTiled(VGImage image, const QSize imageSize, const QRectF &targetRect, void qDrawBorderImage(VGImage image, const QSizeF &textureSize, const QRectF &targetRect, const QRectF &innerTargetRect, const QRectF &subSourceRect) { // Create normalized margins - QMarginsF margins(qMax(innerTargetRect.left() - targetRect.left(), 0.0), - qMax(innerTargetRect.top() - targetRect.top(), 0.0), - qMax(targetRect.right() - innerTargetRect.right(), 0.0), - qMax(targetRect.bottom() - innerTargetRect.bottom(), 0.0)); + QMarginsF margins(qMax(innerTargetRect.left() - targetRect.left(), qreal(0.0)), + qMax(innerTargetRect.top() - targetRect.top(), qreal(0.0)), + qMax(targetRect.right() - innerTargetRect.right(), qreal(0.0)), + qMax(targetRect.bottom() - innerTargetRect.bottom(), qreal(0.0))); QRectF sourceRect(0, 0, textureSize.width(), textureSize.height()); diff --git a/src/qml/doc/src/javascript/number.qdoc b/src/qml/doc/src/javascript/number.qdoc index b6f80f474a..288232255c 100644 --- a/src/qml/doc/src/javascript/number.qdoc +++ b/src/qml/doc/src/javascript/number.qdoc @@ -96,7 +96,7 @@ \code var german = Qt.locale("de_DE"); var d; - d = Number.fromLocaleString(german, "1234,56) // d == 1234.56 + d = Number.fromLocaleString(german, "1234,56") // d == 1234.56 d = Number.fromLocaleString(german, "1.234,56") // d == 1234.56 d = Number.fromLocaleString(german, "1234.56") // throws exception d = Number.fromLocaleString(german, "1.234") // d == 1234.0 diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 1031d686e7..e0bd986920 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -1367,7 +1367,7 @@ QObject *QJSValue::toQObject() const \since 5.8 * If this QJSValue is a QMetaObject, returns the QMetaObject pointer - * that the QJSValue represents; otherwise, returns 0. + * that the QJSValue represents; otherwise, returns \nullptr. * * \sa isQMetaObject() */ diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index 42b61218a5..7bb10f47a3 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -457,7 +457,7 @@ private: InternalClass *addMemberImpl(PropertyKey identifier, PropertyAttributes data, InternalClassEntry *entry); void removeChildEntry(InternalClass *child); - friend struct ExecutionEngine; + friend struct ::QV4::ExecutionEngine; }; inline diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 359ea0fcfa..8f2b162106 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1501,7 +1501,7 @@ ReturnedValue Runtime::CallProperty::call(ExecutionEngine *engine, const Value & if (!f) { QString error = QStringLiteral("Property '%1' of object %2 is not a function") - .arg(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]->toQString(), + .arg(name->toQString(), base->toQStringNoThrow()); return engine->throwTypeError(error); } @@ -2085,6 +2085,7 @@ ReturnedValue Runtime::Div::call(const Value &left, const Value &right) int lval = left.integerValue(); int rval = right.integerValue(); if (rval != 0 // division by zero should result in a NaN + && !(lval == std::numeric_limits<int>::min() && rval == -1) // doesn't fit in int && (lval % rval == 0) // fractions can't be stored in an int && !(lval == 0 && rval < 0)) // 0 / -something results in -0.0 return Encode(int(lval / rval)); diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 09d430b5c0..d2d37164a7 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1263,7 +1263,7 @@ bool QQmlImportsPrivate::locateQmldir(const QString &uri, int vmaj, int vmin, QQ QString url; const QStringRef absolutePath = absoluteFilePath.leftRef(absoluteFilePath.lastIndexOf(Slash) + 1); if (absolutePath.at(0) == Colon) - url = QLatin1String("qrc://") + absolutePath.mid(1); + url = QLatin1String("qrc") + absolutePath; else url = QUrl::fromLocalFile(absolutePath.toString()).toString(); diff --git a/src/qml/qml/qqmltype.cpp b/src/qml/qml/qqmltype.cpp index efe190cbcf..df8078fb58 100644 --- a/src/qml/qml/qqmltype.cpp +++ b/src/qml/qml/qqmltype.cpp @@ -118,7 +118,8 @@ QJSValue QQmlType::SingletonInstanceInfo::scriptApi(QQmlEngine *e) const QQmlTypePrivate::QQmlTypePrivate(QQmlType::RegistrationType type) : regType(type), iid(nullptr), typeId(0), listId(0), revision(0), containsRevisionedAttributes(false), baseMetaObject(nullptr), - index(-1), isSetup(false), isEnumSetup(false), haveSuperType(false) + index(-1), isSetup(false), isEnumFromCacheSetup(false), isEnumFromBaseSetup(false), + haveSuperType(false) { switch (type) { case QQmlType::CppType: @@ -347,19 +348,24 @@ void QQmlTypePrivate::init() const void QQmlTypePrivate::initEnums(const QQmlPropertyCache *cache) const { - if (isEnumSetup) return; + if ((isEnumFromBaseSetup || !baseMetaObject) + && (isEnumFromCacheSetup || !cache)) { + return; + } init(); QMutexLocker lock(QQmlMetaType::typeRegistrationLock()); - if (isEnumSetup) return; - if (cache) + if (!isEnumFromCacheSetup && cache) { insertEnumsFromPropertyCache(cache); - if (baseMetaObject) // could be singleton type without metaobject - insertEnums(baseMetaObject); + isEnumFromCacheSetup = true; + } - isEnumSetup = true; + if (!isEnumFromBaseSetup && baseMetaObject) { // could be singleton type without metaobject + insertEnums(baseMetaObject); + isEnumFromBaseSetup = true; + } } void QQmlTypePrivate::insertEnums(const QMetaObject *metaObject) const diff --git a/src/qml/qml/qqmltype_p_p.h b/src/qml/qml/qqmltype_p_p.h index 380139f385..dd6e046129 100644 --- a/src/qml/qml/qqmltype_p_p.h +++ b/src/qml/qml/qqmltype_p_p.h @@ -120,7 +120,8 @@ public: int index; mutable volatile bool isSetup:1; - mutable volatile bool isEnumSetup:1; + mutable volatile bool isEnumFromCacheSetup:1; + mutable volatile bool isEnumFromBaseSetup:1; mutable bool haveSuperType:1; mutable QList<QQmlProxyMetaObject::ProxyData> metaObjects; mutable QStringHash<int> enums; diff --git a/src/qml/types/qqmlmodelsmodule.cpp b/src/qml/types/qqmlmodelsmodule.cpp index 119ede256f..5423054934 100644 --- a/src/qml/types/qqmlmodelsmodule.cpp +++ b/src/qml/types/qqmlmodelsmodule.cpp @@ -74,9 +74,11 @@ void QQmlModelsModule::defineLabsModule() { const char uri[] = "Qt.labs.qmlmodels"; +#if QT_CONFIG(qml_delegate_model) qmlRegisterUncreatableType<QQmlAbstractDelegateComponent>(uri, 1, 0, "AbstractDelegateComponent", QQmlAbstractDelegateComponent::tr("Cannot create instance of abstract class AbstractDelegateComponent.")); qmlRegisterType<QQmlDelegateChooser>(uri, 1, 0, "DelegateChooser"); qmlRegisterType<QQmlDelegateChoice>(uri, 1, 0, "DelegateChoice"); +#endif qmlRegisterType<QQmlTableModel>(uri, 1, 0, "TableModel"); qmlRegisterType<QQmlTableModelColumn>(uri, 1, 0, "TableModelColumn"); } diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index 1c65534bc2..22fe3df4d0 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -112,14 +112,13 @@ QPointF QQuickDragHandler::targetCentroidPosition() void QQuickDragHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabTransition transition, QQuickEventPoint *point) { QQuickMultiPointHandler::onGrabChanged(grabber, transition, point); - if (grabber == this && transition == QQuickEventPoint::GrabExclusive) { + if (grabber == this && transition == QQuickEventPoint::GrabExclusive && target()) { // In case the grab got handed over from another grabber, we might not get the Press. if (!m_pressedInsideTarget) { - if (target()) + if (target() != parentItem()) m_pressTargetPos = QPointF(target()->width(), target()->height()) / 2; } else if (m_pressTargetPos.isNull()) { - if (target()) - m_pressTargetPos = targetCentroidPosition(); + m_pressTargetPos = targetCentroidPosition(); } } } diff --git a/src/quick/items/qquickrectangle_p_p.h b/src/quick/items/qquickrectangle_p_p.h index c7c5293f9b..f40e5adada 100644 --- a/src/quick/items/qquickrectangle_p_p.h +++ b/src/quick/items/qquickrectangle_p_p.h @@ -64,7 +64,7 @@ class QQuickRectanglePrivate : public QQuickItemPrivate public: QQuickRectanglePrivate() : - color(Qt::white), gradient(0), pen(0), radius(0) + color(Qt::white), gradient(QJSValue::UndefinedValue), pen(0), radius(0) { } diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index d448d74b99..88d419e2b3 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2025,8 +2025,8 @@ bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event) qCDebug(DBG_TOUCH) << event; Q_Q(QQuickWindow); - if (q->mouseGrabberItem()) - q->mouseGrabberItem()->ungrabMouse(); + if (QQuickItem *grabber = q->mouseGrabberItem()) + sendUngrabEvent(grabber, true); cancelTouchMouseSynthesis(); // A TouchCancel event will typically not contain any points. diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp index af0589e5d3..70b74b8877 100644 --- a/src/quick/scenegraph/qsgdefaultcontext.cpp +++ b/src/quick/scenegraph/qsgdefaultcontext.cpp @@ -62,6 +62,8 @@ #include <private/qqmlglobal_p.h> +#include <algorithm> + QT_BEGIN_NAMESPACE namespace QSGMultisampleAntialiasing { @@ -158,11 +160,9 @@ void QSGDefaultContext::renderContextInitialized(QSGRenderContext *renderContext qCDebug(QSG_LOG_INFO, "GL_RENDERER: %s", (const char*)funcs->glGetString(GL_RENDERER)); qCDebug(QSG_LOG_INFO, "GL_VERSION: %s", (const char*)funcs->glGetString(GL_VERSION)); - QSet<QByteArray> exts = openglRenderContext->openglContext()->extensions(); - QByteArray all; - for (const QByteArray &e : qAsConst(exts)) - all += ' ' + e; - qCDebug(QSG_LOG_INFO, "GL_EXTENSIONS: %s", all.constData()); + QByteArrayList exts = openglRenderContext->openglContext()->extensions().toList(); + std::sort(exts.begin(), exts.end()); + qCDebug(QSG_LOG_INFO, "GL_EXTENSIONS: %s", exts.join(' ').constData()); qCDebug(QSG_LOG_INFO, "Max Texture Size: %d", openglRenderContext->maxTextureSize()); qCDebug(QSG_LOG_INFO, "Debug context: %s", format.testOption(QSurfaceFormat::DebugContext) ? "true" : "false"); |
