aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-15 10:55:46 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-15 10:57:49 +0100
commit365a3ac6ae50eb53253eca92bfdf4c527b3a5c05 (patch)
treec6fa0bf4ccf698fa75e2ebc245f95e424438b13a /src
parentdaa866a196962beb6171f847bd6f691f3ae38300 (diff)
parent8ff69297eeddc3f5650c4cc5517c7e2eafaf6c59 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/qmldevtools/qmldevtools.pro tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp Change-Id: I12255c16716bd8a74e7047cdb1f9302a4d1ea827
Diffstat (limited to 'src')
-rw-r--r--src/imports/particles/particles.pro5
-rw-r--r--src/particles/qquickimageparticle.cpp6
-rw-r--r--src/qml/jsruntime/qv4string.cpp12
-rw-r--r--src/qml/types/qqmlconnections.cpp4
-rw-r--r--src/qmltest/quicktestevent.cpp1
-rw-r--r--src/quick/items/qquicktextedit.cpp2
-rw-r--r--src/quick/items/qquickwindow.cpp6
-rw-r--r--src/quick/quick.pro5
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp3
9 files changed, 33 insertions, 11 deletions
diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro
index 4460d03a04..fb9626c40e 100644
--- a/src/imports/particles/particles.pro
+++ b/src/imports/particles/particles.pro
@@ -3,6 +3,11 @@ TARGET = particlesplugin
TARGETPATH = QtQuick/Particles.2
IMPORT_VERSION = 2.0
+greaterThan(QT_GCC_MAJOR_VERSION, 5) {
+ # Our code is bad. Temporary workaround. Fixed in 5.8
+ QMAKE_CXXFLAGS += -fno-delete-null-pointer-checks -fno-lifetime-dse
+}
+
SOURCES += \
plugin.cpp
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index 07cbee1383..84536183ec 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -1291,14 +1291,16 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node)
// OS X 10.8.3 introduced a bug in the AMD drivers, for at least the 2011 macbook pros,
// causing point sprites who read gl_PointCoord in the frag shader to come out as
// green-red blobs.
- if (perfLevel < Deformable && strstr((char *) glGetString(GL_VENDOR), "ATI")) {
+ const GLubyte *glVendor = QOpenGLContext::currentContext()->functions()->glGetString(GL_VENDOR);
+ if (perfLevel < Deformable && glVendor && strstr((char *) glVendor, "ATI")) {
perfLevel = Deformable;
}
#endif
#ifdef Q_OS_LINUX
// Nouveau drivers can potentially freeze a machine entirely when taking the point-sprite path.
- if (perfLevel < Deformable && strstr((const char *) glGetString(GL_VENDOR), "nouveau"))
+ const GLubyte *glVendor = QOpenGLContext::currentContext()->functions()->glGetString(GL_VENDOR);
+ if (perfLevel < Deformable && glVendor && strstr((const char *) glVendor, "nouveau"))
perfLevel = Deformable;
#endif
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index abef885249..a715b65db5 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -46,6 +46,7 @@
#include "qv4stringobject_p.h"
#endif
#include <QtCore/QHash>
+#include <QtCore/private/qnumeric_p.h>
using namespace QV4;
@@ -63,10 +64,15 @@ static uint toArrayIndex(const QChar *ch, const QChar *end)
uint x = ch->unicode() - '0';
if (x > 9)
return UINT_MAX;
- uint n = i*10 + x;
- if (n < i)
- // overflow
+
+ uint n;
+ // n = i * 10 + x, with overflow checking
+ if (mul_overflow(i, 10u, &n))
return UINT_MAX;
+
+ if (add_overflow(n, x, &n))
+ return UINT_MAX;
+
i = n;
++ch;
}
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index a16acac3ab..597e1bfa86 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -166,9 +166,9 @@ private:
void QQmlConnections::setTarget(QObject *obj)
{
Q_D(QQmlConnections);
- d->targetSet = true; // even if setting to 0, it is *set*
- if (d->target == obj)
+ if (d->targetSet && d->target == obj)
return;
+ d->targetSet = true; // even if setting to 0, it is *set*
foreach (QQmlBoundSignal *s, d->boundsignals) {
// It is possible that target is being changed due to one of our signal
// handlers -> use deleteLater().
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp
index 679201732a..32cc5eefd7 100644
--- a/src/qmltest/quicktestevent.cpp
+++ b/src/qmltest/quicktestevent.cpp
@@ -183,6 +183,7 @@ namespace QtQuickTest
case MouseMove:
// with move event the button is NoButton, but 'buttons' holds the currently pressed buttons
me = QMouseEvent(QEvent::MouseMove, pos, window->mapToGlobal(pos), Qt::NoButton, button, stateKey);
+ me.setTimestamp(++lastMouseTimestamp);
break;
default:
QTEST_ASSERT(false);
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index d9179d4cf1..2afaf53d69 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -859,7 +859,7 @@ void QQuickTextEdit::setWrapMode(WrapMode mode)
/*!
\qmlproperty int QtQuick::TextEdit::lineCount
- Returns the total number of lines in the textEdit item.
+ Returns the total number of lines in the TextEdit item.
*/
int QQuickTextEdit::lineCount() const
{
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 83aa58091a..569dd5591c 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -3127,10 +3127,12 @@ void QQuickWindowPrivate::updateDirtyNode(QQuickItem *item)
if (itemPriv->paintNode && itemPriv->paintNode->parent() == 0) {
QSGNode *before = qquickitem_before_paintNode(itemPriv);
- if (before)
+ if (before && before->parent()) {
+ Q_ASSERT(before->parent() == itemPriv->childContainerNode());
itemPriv->childContainerNode()->insertChildNodeAfter(itemPriv->paintNode, before);
- else
+ } else {
itemPriv->childContainerNode()->prependChildNode(itemPriv->paintNode);
+ }
}
} else if (itemPriv->paintNode) {
delete itemPriv->paintNode;
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index 1c14ff8d57..f56fb2e081 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -13,6 +13,11 @@ exists("qqml_enable_gcov") {
LIBS_PRIVATE += -lgcov
}
+greaterThan(QT_GCC_MAJOR_VERSION, 5) {
+ # Our code is bad. Temporary workaround. Fixed in 5.8
+ QMAKE_CXXFLAGS += -fno-delete-null-pointer-checks -fno-lifetime-dse
+}
+
QMAKE_DOCS = $$PWD/doc/qtquick.qdocconf
ANDROID_LIB_DEPENDENCIES = \
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index 27806c48ae..0b2e9e3719 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -116,8 +116,9 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel)
if (image.width() < m_atlas_size_limit && image.height() < m_atlas_size_limit) {
if (!m_atlas)
m_atlas = new Atlas(m_atlas_size);
+ // t may be null for atlas allocation failure
t = m_atlas->create(image);
- if (!hasAlphaChannel && t->hasAlphaChannel())
+ if (t && !hasAlphaChannel && t->hasAlphaChannel())
t->setHasAlphaChannel(false);
}
return t;