aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/particles/particles.pro6
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro7
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro8
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro8
-rw-r--r--src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro8
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro7
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro8
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro8
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp24
-rw-r--r--src/qml/compiler/qqmltypecompiler_p.h1
-rw-r--r--src/qml/jsruntime/qv4mathobject.cpp2
-rw-r--r--src/qml/qml.pro9
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp74
-rw-r--r--src/qml/types/qqmlbind.cpp4
-rw-r--r--src/qmldevtools/qmldevtools.pro4
-rw-r--r--src/qmltest/qmltest.pro4
-rw-r--r--src/quick/items/qquickanimatedsprite.cpp1
-rw-r--r--src/quick/items/qquickflickable.cpp1
-rw-r--r--src/quick/quick.pro4
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp4
-rw-r--r--src/quickwidgets/quickwidgets.pro6
21 files changed, 121 insertions, 77 deletions
diff --git a/src/particles/particles.pro b/src/particles/particles.pro
index ba65ee3002..ab1c854253 100644
--- a/src/particles/particles.pro
+++ b/src/particles/particles.pro
@@ -1,4 +1,5 @@
TARGET = QtQuickParticles
+MODULE = quickparticles
CONFIG += internal_module
@@ -13,7 +14,6 @@ exists("qqml_enable_gcov") {
LIBS_PRIVATE += -lgcov
}
-MODULE = quickparticles
-load(qt_module)
-
include(particles.pri)
+
+load(qt_module)
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro b/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro
index 3703d0fe0b..27b3a5b513 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro
+++ b/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro
@@ -1,10 +1,6 @@
TARGET = qmldbg_debugger
QT = qml-private core-private packetprotocol-private
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QQmlDebuggerServiceFactory
-load(qt_plugin)
-
SOURCES += \
$$PWD/qdebugmessageservice.cpp \
$$PWD/qqmldebuggerservicefactory.cpp \
@@ -37,3 +33,6 @@ INCLUDEPATH += $$PWD \
OTHER_FILES += \
$$PWD/qqmldebuggerservice.json
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QQmlDebuggerServiceFactory
+load(qt_plugin)
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
index c2ee733db6..a8844944e0 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
+++ b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
@@ -1,10 +1,6 @@
TARGET = qmldbg_inspector
QT += qml-private quick-private core-private gui-private packetprotocol-private
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QQmlInspectorServiceFactory
-load(qt_plugin)
-
INCLUDEPATH *= $$PWD $$PWD/../shared
SOURCES += \
@@ -24,3 +20,7 @@ HEADERS += \
OTHER_FILES += \
qqmlinspectorservice.json
+
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QQmlInspectorServiceFactory
+load(qt_plugin)
diff --git a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
index 491be04b15..d731e47b7e 100644
--- a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
+++ b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
@@ -1,10 +1,6 @@
TARGET = qmldbg_local
QT = qml-private
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QLocalClientConnectionFactory
-load(qt_plugin)
-
SOURCES += \
$$PWD/qlocalclientconnection.cpp
@@ -18,3 +14,7 @@ INCLUDEPATH += $$PWD \
OTHER_FILES += \
$$PWD/qlocalclientconnection.json
+
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QLocalClientConnectionFactory
+load(qt_plugin)
diff --git a/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro b/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro
index d490d77e50..b3fe1681e8 100644
--- a/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro
+++ b/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro
@@ -1,10 +1,6 @@
TARGET = qmldbg_native
QT += qml-private core-private packetprotocol-private
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QQmlNativeDebugConnectorFactory
-load(qt_plugin)
-
HEADERS += \
$$PWD/../shared/qqmldebugpacket.h \
$$PWD/qqmlnativedebugconnector.h
@@ -17,3 +13,7 @@ INCLUDEPATH += $$PWD \
OTHER_FILES += \
$$PWD/qqmlnativedebugconnector.json
+
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QQmlNativeDebugConnectorFactory
+load(qt_plugin)
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro b/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro
index 6efe9eacad..4629a7b81e 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro
+++ b/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro
@@ -1,10 +1,6 @@
TARGET = qmldbg_profiler
QT = qml-private core-private packetprotocol-private
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QQmlProfilerServiceFactory
-load(qt_plugin)
-
SOURCES += \
$$PWD/qqmlenginecontrolservice.cpp \
$$PWD/qqmlprofileradapter.cpp \
@@ -27,3 +23,6 @@ INCLUDEPATH += $$PWD \
OTHER_FILES += \
$$PWD/qqmlprofilerservice.json
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QQmlProfilerServiceFactory
+load(qt_plugin)
diff --git a/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro b/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro
index 923faa01f3..fffdb4c888 100644
--- a/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro
+++ b/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro
@@ -1,10 +1,6 @@
TARGET = qmldbg_server
QT = qml-private packetprotocol-private
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QQmlDebugServerFactory
-load(qt_plugin)
-
SOURCES += \
$$PWD/qqmldebugserver.cpp
@@ -19,3 +15,7 @@ INCLUDEPATH += $$PWD \
OTHER_FILES += \
qqmldebugserver.json
+
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QQmlDebugServerFactory
+load(qt_plugin)
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
index fd419aeb56..1face1813e 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
+++ b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
@@ -1,10 +1,6 @@
TARGET = qmldbg_tcp
QT = qml-private network
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QTcpServerConnectionFactory
-load(qt_plugin)
-
SOURCES += \
$$PWD/qtcpserverconnection.cpp
@@ -18,3 +14,7 @@ INCLUDEPATH += $$PWD \
OTHER_FILES += \
$$PWD/qtcpserverconnection.json
+
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QTcpServerConnectionFactory
+load(qt_plugin)
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index a708e90116..33716d57b8 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -1163,6 +1163,17 @@ struct StaticQtMetaObject : public QObject
{ return &staticQtMetaObject; }
};
+bool QQmlEnumTypeResolver::assignEnumToBinding(QmlIR::Binding *binding, const QString &enumName, int enumValue, bool isQtObject)
+{
+ if (enumName.length() > 0 && enumName[0].isLower() && !isQtObject) {
+ COMPILE_EXCEPTION(binding, tr("Invalid property assignment: Enum value \"%1\" cannot start with a lowercase letter").arg(enumName));
+ }
+ binding->type = QV4::CompiledData::Binding::Type_Number;
+ binding->value.d = (double)enumValue;
+ binding->flags |= QV4::CompiledData::Binding::IsResolvedEnum;
+ return true;
+}
+
bool QQmlEnumTypeResolver::tryQualifiedEnumAssignment(const QmlIR::Object *obj, const QQmlPropertyCache *propertyCache, const QQmlPropertyData *prop, QmlIR::Binding *binding)
{
bool isIntProp = (prop->propType == QMetaType::Int) && !prop->isEnum();
@@ -1185,6 +1196,7 @@ bool QQmlEnumTypeResolver::tryQualifiedEnumAssignment(const QmlIR::Object *obj,
return true;
QHashedStringRef typeName(string.constData(), dot);
+ const bool isQtObject = (typeName == QLatin1String("Qt"));
QString enumValue = string.mid(dot+1);
if (isIntProp) {
@@ -1192,16 +1204,15 @@ bool QQmlEnumTypeResolver::tryQualifiedEnumAssignment(const QmlIR::Object *obj,
bool ok;
int enumval = evaluateEnum(typeName.toString(), enumValue.toUtf8(), &ok);
if (ok) {
- binding->type = QV4::CompiledData::Binding::Type_Number;
- binding->value.d = (double)enumval;
- binding->flags |= QV4::CompiledData::Binding::IsResolvedEnum;
+ if (!assignEnumToBinding(binding, enumValue, enumval, isQtObject))
+ return false;
}
return true;
}
QQmlType *type = 0;
imports->resolveType(typeName, &type, 0, 0, 0);
- if (!type && typeName != QLatin1String("Qt"))
+ if (!type && !isQtObject)
return true;
int value = 0;
@@ -1234,10 +1245,7 @@ bool QQmlEnumTypeResolver::tryQualifiedEnumAssignment(const QmlIR::Object *obj,
if (!ok)
return true;
- binding->type = QV4::CompiledData::Binding::Type_Number;
- binding->value.d = (double)value;
- binding->flags |= QV4::CompiledData::Binding::IsResolvedEnum;
- return true;
+ return assignEnumToBinding(binding, enumValue, value, isQtObject);
}
int QQmlEnumTypeResolver::evaluateEnum(const QString &scope, const QByteArray &enumValue, bool *ok) const
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h
index 3404350ece..240f591f91 100644
--- a/src/qml/compiler/qqmltypecompiler_p.h
+++ b/src/qml/compiler/qqmltypecompiler_p.h
@@ -196,6 +196,7 @@ public:
bool resolveEnumBindings();
private:
+ bool assignEnumToBinding(QmlIR::Binding *binding, const QString &enumName, int enumValue, bool isQtObject);
bool tryQualifiedEnumAssignment(const QmlIR::Object *obj, const QQmlPropertyCache *propertyCache,
const QQmlPropertyData *prop,
QmlIR::Binding *binding);
diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp
index f264ec028e..8c5e7d8be1 100644
--- a/src/qml/jsruntime/qv4mathobject.cpp
+++ b/src/qml/jsruntime/qv4mathobject.cpp
@@ -51,8 +51,6 @@ using namespace QV4;
DEFINE_OBJECT_VTABLE(MathObject);
-static const double qt_PI = 2.0 * ::asin(1.0);
-
Heap::MathObject::MathObject()
{
Scope scope(internalClass->engine);
diff --git a/src/qml/qml.pro b/src/qml/qml.pro
index d75262bf0b..e30c39c8b9 100644
--- a/src/qml/qml.pro
+++ b/src/qml/qml.pro
@@ -11,9 +11,6 @@ solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
# Ensure this gcc optimization is switched off for mips platforms to avoid trouble with JIT.
gcc:isEqual(QT_ARCH, "mips"): QMAKE_CXXFLAGS += -fno-reorder-blocks
-MODULE_PLUGIN_TYPES = \
- qmltooling
-
exists("qqml_enable_gcov") {
QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors
LIBS_PRIVATE += -lgcov
@@ -29,8 +26,6 @@ greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 3)| \
if(equals(QT_APPLE_CLANG_MAJOR_VERSION, 5):greaterThan(QT_APPLE_CLANG_MINOR_VERSION, 0)): \
WERROR += -Wno-error=unused-const-variable
-load(qt_module)
-
HEADERS += qtqmlglobal.h \
qtqmlglobal_p.h
@@ -46,3 +41,7 @@ include(qml/qml.pri)
include(debugger/debugger.pri)
include(animations/animations.pri)
include(types/types.pri)
+
+MODULE_PLUGIN_TYPES = \
+ qmltooling
+load(qt_module)
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 2f2c6cf7dc..33fe655368 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -125,6 +125,28 @@ ReturnedValue QmlTypeWrapper::create(QV4::ExecutionEngine *engine, QObject *o, Q
return w.asReturnedValue();
}
+static int enumForSingleton(String *name, QObject *qobjectSingleton)
+{
+ // ### Optimize
+ QByteArray enumName = name->toQString().toUtf8();
+ const QMetaObject *metaObject = qobjectSingleton->metaObject();
+ for (int ii = metaObject->enumeratorCount() - 1; ii >= 0; --ii) {
+ QMetaEnum e = metaObject->enumerator(ii);
+ bool ok;
+ int value = e.keyToValue(enumName.constData(), &ok);
+ if (ok)
+ return value;
+ }
+ return -1;
+}
+
+static ReturnedValue throwLowercaseEnumError(QV4::ExecutionEngine *v4, String *name, QQmlType *type)
+{
+ const QString message =
+ QStringLiteral("Cannot access enum value '%1' of '%2', enum values need to start with an uppercase letter.")
+ .arg(name->toQString()).arg(QLatin1String(type->typeName()));
+ return v4->throwTypeError(message);
+}
ReturnedValue QmlTypeWrapper::get(const Managed *m, String *name, bool *hasProperty)
{
@@ -141,9 +163,9 @@ ReturnedValue QmlTypeWrapper::get(const Managed *m, String *name, bool *hasPrope
QQmlContextData *context = v4->callingQmlContext();
QObject *object = w->d()->object;
+ QQmlType *type = w->d()->type;
- if (w->d()->type) {
- QQmlType *type = w->d()->type;
+ if (type) {
// singleton types are handled differently to other types.
if (type->isSingleton()) {
@@ -153,24 +175,29 @@ ReturnedValue QmlTypeWrapper::get(const Managed *m, String *name, bool *hasPrope
QObject *qobjectSingleton = siinfo->qobjectApi(e);
if (qobjectSingleton) {
+
// check for enum value
- if (name->startsWithUpper()) {
- if (w->d()->mode == Heap::QmlTypeWrapper::IncludeEnums) {
- // ### Optimize
- QByteArray enumName = name->toQString().toUtf8();
- const QMetaObject *metaObject = qobjectSingleton->metaObject();
- for (int ii = metaObject->enumeratorCount() - 1; ii >= 0; --ii) {
- QMetaEnum e = metaObject->enumerator(ii);
- bool ok;
- int value = e.keyToValue(enumName.constData(), &ok);
- if (ok)
- return QV4::Primitive::fromInt32(value).asReturnedValue();
- }
- }
+ const bool includeEnums = w->d()->mode == Heap::QmlTypeWrapper::IncludeEnums;
+ if (includeEnums && name->startsWithUpper()) {
+ const int value = enumForSingleton(name, qobjectSingleton);
+ if (value != -1)
+ return QV4::Primitive::fromInt32(value).asReturnedValue();
}
// check for property.
- return QV4::QObjectWrapper::getQmlProperty(v4, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision, hasProperty);
+ bool ok;
+ const ReturnedValue result = QV4::QObjectWrapper::getQmlProperty(v4, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision, &ok);
+ if (hasProperty)
+ *hasProperty = ok;
+
+ // Warn when attempting to access a lowercased enum value, singleton case
+ if (!ok && includeEnums && !name->startsWithUpper()) {
+ const int value = enumForSingleton(name, qobjectSingleton);
+ if (value != -1)
+ return throwLowercaseEnumError(v4, name, type);
+ }
+
+ return result;
} else if (!siinfo->scriptApi(e).isUndefined()) {
// NOTE: if used in a binding, changes will not trigger re-evaluation since non-NOTIFYable.
QV4::ScopedObject o(scope, QJSValuePrivate::convertedToValue(v4, siinfo->scriptApi(e)));
@@ -227,9 +254,20 @@ ReturnedValue QmlTypeWrapper::get(const Managed *m, String *name, bool *hasPrope
Q_ASSERT(!"Unreachable");
}
+ bool ok = false;
+ const ReturnedValue result = Object::get(m, name, &ok);
if (hasProperty)
- *hasProperty = false;
- return Object::get(m, name, hasProperty);
+ *hasProperty = ok;
+
+ // Warn when attempting to access a lowercased enum value, non-singleton case
+ if (!ok && type && !type->isSingleton() && !name->startsWithUpper()) {
+ bool enumOk = false;
+ type->enumValue(QQmlEnginePrivate::get(v4->qmlEngine()), name, &enumOk);
+ if (enumOk)
+ return throwLowercaseEnumError(v4, name, type);
+ }
+
+ return result;
}
diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp
index e2063dee7d..ed9a8533c0 100644
--- a/src/qml/types/qqmlbind.cpp
+++ b/src/qml/types/qqmlbind.cpp
@@ -75,7 +75,7 @@ public:
void QQmlBindPrivate::validate(QObject *binding) const
{
- if (!obj)
+ if (!obj || (when.isValid() && !when))
return;
if (!prop.isValid()) {
@@ -185,6 +185,8 @@ void QQmlBind::setWhen(bool v)
return;
d->when = v;
+ if (v && d->componentComplete)
+ d->validate(this);
eval();
}
diff --git a/src/qmldevtools/qmldevtools.pro b/src/qmldevtools/qmldevtools.pro
index 0e32dc51e2..acd5c9729b 100644
--- a/src/qmldevtools/qmldevtools.pro
+++ b/src/qmldevtools/qmldevtools.pro
@@ -13,10 +13,10 @@ intel_icc: WERROR += -ww2415
clang:if(greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 3)): \
WERROR += -Wno-error=unused-const-variable
-load(qt_module)
-
include(../3rdparty/masm/masm-defs.pri)
include(../qml/parser/parser.pri)
include(../qml/jsruntime/jsruntime.pri)
include(../qml/compiler/compiler.pri)
include(../qml/memory/memory.pri)
+
+load(qt_module)
diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro
index 289a0584e0..42224e9751 100644
--- a/src/qmltest/qmltest.pro
+++ b/src/qmltest/qmltest.pro
@@ -13,8 +13,6 @@ qtHaveModule(widgets) {
DEFINES += QT_QMLTEST_WITH_WIDGETS
}
-load(qt_module)
-
# Install qmltestcase.prf into the Qt mkspecs so that "CONFIG += qmltestcase"
# can be used in customer applications to build against QtQuickTest.
feature.path = $$[QT_INSTALL_DATA]/mkspecs/features
@@ -33,3 +31,5 @@ HEADERS += \
$$PWD/qtestoptions_p.h
DEFINES += QT_QML_DEBUG_NO_WARNING
+
+load(qt_module)
diff --git a/src/quick/items/qquickanimatedsprite.cpp b/src/quick/items/qquickanimatedsprite.cpp
index b3c1e8fb40..f5df5763bb 100644
--- a/src/quick/items/qquickanimatedsprite.cpp
+++ b/src/quick/items/qquickanimatedsprite.cpp
@@ -544,6 +544,7 @@ QSGGeometryNode* QQuickAnimatedSprite::buildNode()
m_node->setGeometry(g);
m_node->setMaterial(m_material);
m_node->setFlag(QSGGeometryNode::OwnsMaterial);
+ m_node->setFlag(QSGGeometryNode::OwnsGeometry);
sizeVertices();
return m_node;
}
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 3bfd1e8b9a..b0245f402b 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1396,6 +1396,7 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
d->timer.start();
d->maybeBeginDrag(currentTimestamp, event->posF());
break;
+ case Qt::NoScrollPhase: // default phase with an ordinary wheel mouse
case Qt::ScrollUpdate:
if (d->scrollingPhase) {
d->pressed = true;
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index c8aa47d939..1c14ff8d57 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -24,8 +24,6 @@ ANDROID_BUNDLED_FILES += \
qml \
lib/libQt5QuickParticles.so
-load(qt_module)
-
include(util/util.pri)
include(scenegraph/scenegraph.pri)
include(items/items.pri)
@@ -43,3 +41,5 @@ SOURCES += qtquick2.cpp
# To make #include "qquickcontext2d_jsclass.cpp" work
INCLUDEPATH += $$PWD
+
+load(qt_module)
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index a85a9ab3eb..bb5476c3e2 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -2698,7 +2698,9 @@ void Renderer::render()
if (m_alphaBatches.size())
std::sort(&m_alphaBatches.first(), &m_alphaBatches.last() + 1, qsg_sort_batch_increasing_order);
- m_zRange = 1.0 / (m_nextRenderOrder);
+ m_zRange = m_nextRenderOrder != 0
+ ? 1.0 / (m_nextRenderOrder)
+ : 0;
}
if (Q_UNLIKELY(debug_render())) timeSorting = timer.restart();
diff --git a/src/quickwidgets/quickwidgets.pro b/src/quickwidgets/quickwidgets.pro
index ab388ff9d3..87409e31c5 100644
--- a/src/quickwidgets/quickwidgets.pro
+++ b/src/quickwidgets/quickwidgets.pro
@@ -4,9 +4,6 @@ QT = core-private gui-private qml-private quick-private widgets-private
DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES
-
-load(qt_module)
-
HEADERS += \
qquickwidget.h \
qquickwidget_p.h \
@@ -15,5 +12,4 @@ HEADERS += \
SOURCES += \
qquickwidget.cpp
-
-
+load(qt_module)