aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-12 20:49:36 +0200
committerLiang Qi <liang.qi@qt.io>2016-10-12 20:49:45 +0200
commitb4cdfc4a12d2b9ebc79fe17a2f1aff67bd940d71 (patch)
treee7841ee2695a3ef180e186d2df971c8fc207d0f9 /src
parent650b5db06b057abe2db40fb8d56223e17ba8c06a (diff)
parentaf002b8df9b084fd7f26e9eead9844aab36bdc4d (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/masm/wtf/MathExtras.h2
-rw-r--r--src/qml/doc/src/cppclasses/topic.qdoc4
-rw-r--r--src/qml/doc/src/cppintegration/exposecppattributes.qdoc2
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/scope.qdoc2
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc2
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp4
-rw-r--r--src/qml/jsruntime/qv4internalclass.cpp12
-rw-r--r--src/qml/jsruntime/qv4managed_p.h16
-rw-r--r--src/qml/jsruntime/qv4object_p.h12
-rw-r--r--src/qml/jsruntime/qv4sequenceobject.cpp24
-rw-r--r--src/qmltest/quicktestevent.cpp10
-rw-r--r--src/quick/doc/src/concepts/input/focus.qdoc12
-rw-r--r--src/quick/items/qquicklistview.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode.cpp16
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode_p.h2
15 files changed, 82 insertions, 40 deletions
diff --git a/src/3rdparty/masm/wtf/MathExtras.h b/src/3rdparty/masm/wtf/MathExtras.h
index 9c38af6b16..75e3670367 100644
--- a/src/3rdparty/masm/wtf/MathExtras.h
+++ b/src/3rdparty/masm/wtf/MathExtras.h
@@ -152,7 +152,7 @@ inline long lroundf(float num) { return static_cast<long>(roundf(num)); }
inline long long abs(long num) { return labs(num); }
#endif
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) && COMPILER(MSVC12_OR_LOWER)
// MSVC's math.h does not currently supply log2 or log2f.
inline double log2(double num)
{
diff --git a/src/qml/doc/src/cppclasses/topic.qdoc b/src/qml/doc/src/cppclasses/topic.qdoc
index ddb29fbb14..133f9bc72c 100644
--- a/src/qml/doc/src/cppclasses/topic.qdoc
+++ b/src/qml/doc/src/cppclasses/topic.qdoc
@@ -91,7 +91,7 @@ at run-time using a QQmlComponent. An instance of the QQmlComponent class can
be created in C++ directly, or via the \l{QtQml::Qt::createComponent()}
{Qt.createComponent()} function in imperative QML code. Arbitrary expressions
can be calculated in C++ via the QQmlExpression class, and such expressions
-can interact directly the QML context.
+can interact directly with the QML context.
\section2 The QQmlComponent Class
@@ -106,7 +106,7 @@ how to use QQmlComponent.
The QQmlExpression class provides a way for clients to evaluate JavaScript
expressions from C++, using a particular QML evaluation context. This allows
-clients to access QML objects by id, for example. The result of evaluation
+clients to access QML objects by id, for example. The result of the evaluation
is returned as a QVariant, and the conversion rules are defined by the QML
engine.
diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
index f5aea0b01a..ed0d049564 100644
--- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
+++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
@@ -71,7 +71,7 @@ type that is supported by the QML engine.
By default, the engine supports a number of Qt C++ types and can automatically
convert them as appropriately when used from QML. Additionally, C++ classes
that are \l{Registering C++ types with the QML type system}{registered} with
-the QML type system can be can be used as data types, as can their enums if
+the QML type system can be used as data types, as can their enums if
appropriately registered. See \l{qtqml-cppintegration-data.html}{Data Type
Conversion Between QML and C++} for further information.
diff --git a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
index 3e3bbaca98..eaf1747a6d 100644
--- a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
+++ b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
@@ -105,7 +105,7 @@ ListView {
\section1 Binding Scope Object
-An object which has a \l{Property Binding}{property binding} is known has the
+An object which has a \l{Property Binding}{property binding} is known as the
binding's \e{scope object}. In the following example, the \l Item object is
the binding's scope object.
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
index db9eee7714..030eb72b5f 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
@@ -191,7 +191,7 @@ which was then imported by the client), then a property of type
\section3 Assigning Values to Property Attributes
-The value of a property of an object instance may specified in two separate ways:
+The value of a property of an object instance may be specified in two separate ways:
\list
\li a value assignment on initialization
\li an imperative value assignment
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
index 62ece57c41..03ae23175b 100644
--- a/src/qml/jsruntime/qv4arraydata.cpp
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -46,6 +46,8 @@
using namespace QV4;
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON
+
const QV4::VTable QV4::ArrayData::static_vtbl = {
0,
QV4::ArrayData::IsExecutionContext,
@@ -94,6 +96,8 @@ const ArrayVTable SparseArrayData::static_vtbl =
SparseArrayData::length
};
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
+
Q_STATIC_ASSERT(sizeof(Heap::ArrayData) == sizeof(Heap::SimpleArrayData));
Q_STATIC_ASSERT(sizeof(Heap::ArrayData) == sizeof(Heap::SparseArrayData));
diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp
index af359bc0d3..2f69defd5b 100644
--- a/src/qml/jsruntime/qv4internalclass.cpp
+++ b/src/qml/jsruntime/qv4internalclass.cpp
@@ -146,16 +146,20 @@ static void insertHoleIntoPropertyData(Object *object, int idx)
int icSize = object->internalClass()->size;
int from = qMax(idx, inlineSize);
int to = from + 1;
- if (from < icSize)
- memmove(object->propertyData(to), object->propertyData(from), icSize - from - 1);
+ if (from < icSize) {
+ memmove(object->propertyData(to), object->propertyData(from),
+ (icSize - from - 1) * sizeof(Value));
+ }
if (from == idx)
return;
if (inlineSize < icSize)
*object->propertyData(inlineSize) = *object->propertyData(inlineSize - 1);
from = idx;
to = from + 1;
- if (from < inlineSize - 1)
- memmove(object->propertyData(to), object->propertyData(from), inlineSize - from - 1);
+ if (from < inlineSize - 1) {
+ memmove(object->propertyData(to), object->propertyData(from),
+ (inlineSize - from - 1) * sizeof(Value));
+ }
}
static void removeFromPropertyData(Object *object, int idx, bool accessor = false)
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 1109760fc0..d73b990470 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -100,6 +100,18 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
#define Q_VTABLE_FUNCTION(classname, func) \
(classname::func == QV4::Managed::func ? 0 : classname::func)
+// Q_VTABLE_FUNCTION triggers a bogus tautological-compare warning in GCC6+
+#if defined(Q_CC_GNU) && Q_CC_GNU >= 600
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
+ QT_WARNING_PUSH; \
+ QT_WARNING_DISABLE_GCC("-Wtautological-compare")
+
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF \
+ ;QT_WARNING_POP
+#else
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
+#endif
#define DEFINE_MANAGED_VTABLE_INT(classname, parentVTable) \
{ \
@@ -119,7 +131,9 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
}
#define DEFINE_MANAGED_VTABLE(classname) \
-const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, 0)
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
+const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, 0) \
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
struct Q_QML_PRIVATE_EXPORT Managed : Value
{
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index fe6b487a83..82f75a49c6 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -130,7 +130,7 @@ struct ObjectVTable
void (*advanceIterator)(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);
};
-#define DEFINE_OBJECT_VTABLE(classname) \
+#define DEFINE_OBJECT_VTABLE_BASE(classname) \
const QV4::ObjectVTable classname::static_vtbl = \
{ \
DEFINE_MANAGED_VTABLE_INT(classname, (QT_PREPEND_NAMESPACE(QtPrivate)::is_same<classname::SuperClass, Object>::value) ? Q_NULLPTR : &classname::SuperClass::static_vtbl.vTable), \
@@ -150,7 +150,15 @@ const QV4::ObjectVTable classname::static_vtbl = \
advanceIterator \
}
-
+#define DEFINE_OBJECT_VTABLE(classname) \
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
+DEFINE_OBJECT_VTABLE_BASE(classname) \
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
+
+#define DEFINE_OBJECT_TEMPLATE_VTABLE(classname) \
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
+template<> DEFINE_OBJECT_VTABLE_BASE(classname) \
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
struct Q_QML_EXPORT Object: Managed {
V4_OBJECT2(Object, Object)
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp
index fa2409a85c..f3c1a88465 100644
--- a/src/qml/jsruntime/qv4sequenceobject.cpp
+++ b/src/qml/jsruntime/qv4sequenceobject.cpp
@@ -591,29 +591,21 @@ typedef QQmlSequence<QVector<bool> > QQmlBoolVectorList;
template<>
DEFINE_OBJECT_VTABLE(QQmlBoolVectorList);
typedef QQmlSequence<QStringList> QQmlQStringList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlQStringList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlQStringList);
typedef QQmlSequence<QList<QString> > QQmlStringList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlStringList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlStringList);
typedef QQmlSequence<QList<int> > QQmlIntList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlIntList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlIntList);
typedef QQmlSequence<QList<QUrl> > QQmlUrlList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlUrlList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlUrlList);
typedef QQmlSequence<QModelIndexList> QQmlQModelIndexList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlQModelIndexList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlQModelIndexList);
typedef QQmlSequence<QItemSelection> QQmlQItemSelectionRangeList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlQItemSelectionRangeList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlQItemSelectionRangeList);
typedef QQmlSequence<QList<bool> > QQmlBoolList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlBoolList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlBoolList);
typedef QQmlSequence<QList<qreal> > QQmlRealList;
-template<>
-DEFINE_OBJECT_VTABLE(QQmlRealList);
+DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlRealList);
}
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp
index f722fab6c4..679201732a 100644
--- a/src/qmltest/quicktestevent.cpp
+++ b/src/qmltest/quicktestevent.cpp
@@ -124,6 +124,8 @@ namespace QtQuickTest
{
enum MouseAction { MousePress, MouseRelease, MouseClick, MouseDoubleClick, MouseMove, MouseDoubleClickSequence };
+ int lastMouseTimestamp = 0;
+
static void mouseEvent(MouseAction action, QWindow *window,
QObject *item, Qt::MouseButton button,
Qt::KeyboardModifiers stateKey, QPointF _pos, int delay=-1)
@@ -133,8 +135,10 @@ namespace QtQuickTest
if (delay == -1 || delay < QTest::defaultMouseDelay())
delay = QTest::defaultMouseDelay();
- if (delay > 0)
+ if (delay > 0) {
QTest::qWait(delay);
+ lastMouseTimestamp += delay;
+ }
if (action == MouseClick) {
mouseEvent(MousePress, window, item, button, stateKey, _pos);
@@ -165,12 +169,16 @@ namespace QtQuickTest
{
case MousePress:
me = QMouseEvent(QEvent::MouseButtonPress, pos, window->mapToGlobal(pos), button, button, stateKey);
+ me.setTimestamp(++lastMouseTimestamp);
break;
case MouseRelease:
me = QMouseEvent(QEvent::MouseButtonRelease, pos, window->mapToGlobal(pos), button, 0, stateKey);
+ me.setTimestamp(++lastMouseTimestamp);
+ lastMouseTimestamp += 500; // avoid double clicks being generated
break;
case MouseDoubleClick:
me = QMouseEvent(QEvent::MouseButtonDblClick, pos, window->mapToGlobal(pos), button, button, stateKey);
+ me.setTimestamp(++lastMouseTimestamp);
break;
case MouseMove:
// with move event the button is NoButton, but 'buttons' holds the currently pressed buttons
diff --git a/src/quick/doc/src/concepts/input/focus.qdoc b/src/quick/doc/src/concepts/input/focus.qdoc
index ec4e4ca2d9..fc1361f7ac 100644
--- a/src/quick/doc/src/concepts/input/focus.qdoc
+++ b/src/quick/doc/src/concepts/input/focus.qdoc
@@ -66,7 +66,7 @@ See also the \l {Keys}{Keys attached property} and \l {KeyNavigation}{KeyNavigat
\section1 Querying the Active Focus Item
Whether or not an \l Item has active focus can be queried through the
-property \c {Item::activeFocus} property. For example, here we have a \l Text
+\c {Item::activeFocus} property. For example, here we have a \l Text
type whose text is determined by whether or not it has active focus.
\snippet qml/focus/rectangle.qml active focus
@@ -98,17 +98,17 @@ The code that imports and creates two MyWidget instances:
The MyWidget code:
\snippet qml/focus/MyWidget.qml mywidget
-We would like to have the first MyWidget object to have the focus by setting its
+We want the first \c MyWidget object to have the focus, so we set its
\c focus property to \c true. However, by running the code, we can confirm that
the second widget receives the focus.
\image declarative-qmlfocus2.png
Looking at both \c MyWidget and \c window code, the problem is evident - there
-are three types that set the \c focus property set to \c true. The two
-MyWidget sets the \c focus to \c true and the \c window component also sets the
+are three types that set the \c focus property to \c true. The two
+\c {MyWidget}s set the \c focus to \c true and the \c window component also sets the
focus. Ultimately, only one type can have keyboard focus, and the system has
-to decide which type receives the focus. When the second MyWidget is created,
+to decide which type receives the focus. When the second \c MyWidget is created,
it receives the focus because it is the last type to set its \c focus
property to \c true.
@@ -190,7 +190,7 @@ print the name of the current list item.
\image declarative-qmlfocus5.png
-While the example is simple, there are a lot going on behind the scenes. Whenever
+While the example is simple, there is a lot going on behind the scenes. Whenever
the current item changes, the \l ListView sets the delegate's \c {Item::focus}
property. As the \l ListView is a focus scope, this doesn't affect the
rest of the application. However, if the \l ListView itself has
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index a98a5c8f56..b9f4fc5d42 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1761,7 +1761,7 @@ bool QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
State should \e never be stored in a delegate.
ListView attaches a number of properties to the root item of the delegate, for example
- \c {ListView:isCurrentItem}. In the following example, the root delegate item can access
+ \c ListView.isCurrentItem. In the following example, the root delegate item can access
this attached property directly as \c ListView.isCurrentItem, while the child
\c contactInfo object must refer to this property as \c wrapper.ListView.isCurrentItem.
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
index 3e5ed72d0f..16625b889b 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
@@ -442,9 +442,21 @@ void QSGDefaultPainterNode::setContentsScale(qreal s)
markDirty(DirtyMaterial);
}
-void QSGDefaultPainterNode::setFastFBOResizing(bool dynamic)
+void QSGDefaultPainterNode::setFastFBOResizing(bool fastResizing)
{
- m_fastFBOResizing = dynamic;
+ if (m_fastFBOResizing == fastResizing)
+ return;
+
+ m_fastFBOResizing = fastResizing;
+ updateFBOSize();
+
+ if ((m_preferredRenderTarget == QQuickPaintedItem::FramebufferObject
+ || m_preferredRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject)
+ && (!m_fbo || (m_fbo && m_fbo->size() != m_fboSize))) {
+ m_dirtyRenderTarget = true;
+ m_dirtyGeometry = true;
+ m_dirtyTexture = true;
+ }
}
QImage QSGDefaultPainterNode::toImage() const
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
index 3cabe01511..7e23264100 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
@@ -108,7 +108,7 @@ public:
void setContentsScale(qreal s);
qreal contentsScale() const { return m_contentsScale; }
- void setFastFBOResizing(bool dynamic);
+ void setFastFBOResizing(bool fastResizing);
bool fastFBOResizing() const { return m_fastFBOResizing; }
void setTextureSize(const QSize &textureSize);