From e330198669f8897212912caee65ae8910ad77519 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 17 Aug 2016 13:21:22 +0300 Subject: QQuickListView: fix doc for itemAt() and indexAt() These methods have real arguments. Change-Id: Ieb4ea8396876f237adedf5df8ab5aeec1055229f Reviewed-by: Shawn Rutledge --- src/quick/items/qquicklistview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index b324e00cac..9f126525d6 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -3318,7 +3318,7 @@ void QQuickListViewPrivate::translateAndTransitionItemsAfter(int afterModelIndex */ /*! - \qmlmethod int QtQuick::ListView::indexAt(int x, int y) + \qmlmethod int QtQuick::ListView::indexAt(real x, real y) Returns the index of the visible item containing the point \a x, \a y in content coordinates. If there is no item at the point specified, or the item is @@ -3331,7 +3331,7 @@ void QQuickListViewPrivate::translateAndTransitionItemsAfter(int afterModelIndex */ /*! - \qmlmethod Item QtQuick::ListView::itemAt(int x, int y) + \qmlmethod Item QtQuick::ListView::itemAt(real x, real y) Returns the visible item containing the point \a x, \a y in content coordinates. If there is no item at the point specified, or the item is -- cgit v1.2.3 From 24e6df252dc6118541d064835cea6ee470985dae Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 17 Aug 2016 13:20:16 +0300 Subject: QQuickGridView: fix doc for itemAt() and indexAt() These methods have real arguments. Change-Id: I5362a407b8417b62bb27bb313dccce8611b5e316 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickgridview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp index 6e5710a97b..e78ad07548 100644 --- a/src/quick/items/qquickgridview.cpp +++ b/src/quick/items/qquickgridview.cpp @@ -2586,7 +2586,7 @@ bool QQuickGridViewPrivate::needsRefillForAddedOrRemovedIndex(int modelIndex) co */ /*! - \qmlmethod int QtQuick::GridView::indexAt(int x, int y) + \qmlmethod int QtQuick::GridView::indexAt(real x, real y) Returns the index of the visible item containing the point \a x, \a y in content coordinates. If there is no item at the point specified, or the item is @@ -2599,7 +2599,7 @@ bool QQuickGridViewPrivate::needsRefillForAddedOrRemovedIndex(int modelIndex) co */ /*! - \qmlmethod Item QtQuick::GridView::itemAt(int x, int y) + \qmlmethod Item QtQuick::GridView::itemAt(real x, real y) Returns the visible item containing the point \a x, \a y in content coordinates. If there is no item at the point specified, or the item is -- cgit v1.2.3 From 2a4f543ca2b0f90262184fa97f9c386737ec6dd1 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 17 Aug 2016 14:58:40 +0200 Subject: QML: Do not register dependencies of deleted binding Because it can lead to a use-after-free. Change-Id: I6701b370c0ecee4967e5f749f673a6f9ee3d504c Reviewed-by: Simon Hausmann --- src/qml/qml/qqmljavascriptexpression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 5938ebf5d7..cd2f120218 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -296,7 +296,7 @@ void QQmlPropertyCapture::registerQmlDependencies(QV4::ExecutionEngine *engine, if (!ep) return; QQmlPropertyCapture *capture = ep->propertyCapture; - if (!capture) + if (!capture || capture->watcher->wasDeleted()) return; QV4::Scope scope(engine); -- cgit v1.2.3 From 4a9635b0bfdc6a189375bc48e68b00bd05e15c82 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Wed, 10 Aug 2016 15:49:43 +0200 Subject: Remove some double-meaning text from documentation Change-Id: I9b69dbe929947795bdfbff4e0e3a16a47fa94197 Reviewed-by: Simon Hausmann --- src/qml/doc/src/cppintegration/exposecppattributes.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc index c7e4930bfb..f5aea0b01a 100644 --- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc +++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc @@ -73,7 +73,7 @@ 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 appropriately registered. See \l{qtqml-cppintegration-data.html}{Data Type -Conversion Between QML and C++} for details for further information. +Conversion Between QML and C++} for further information. Additionally, data ownership rules are taken into consideration when data is transferred from C++ to QML. See \l {Data Ownership} for more details. -- cgit v1.2.3 From 01a9c006b0cb3f9ec7c140d25e6bfa3ca6250a4c Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 19 Aug 2016 10:01:30 +0200 Subject: TestCase::mouseDrag: set mouse move delay >= 1 ms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Infinite-speed drags do not work well with velocity-sensitive components like Flickable. As with change d04982dc on qtbase, adding a short delay helps to stabilize tests. To keep it flexible, we make QTest::defaultMouseDelay() available via the qtest_events.defaultMouseDelay property. So the delay can be increased by passing a larger delay value to mouseDrag, or by changing the QTEST_MOUSEEVENT_DELAY environment variable (as before). Task-number: QTBUG-55382 Change-Id: I8f8088758a206be104a439ee0d1832eeca574e8c Reviewed-by: Liang Qi Reviewed-by: Jan Arve Sæther --- src/imports/testlib/TestCase.qml | 9 +++++---- src/qmltest/quicktestevent.cpp | 13 +++++++++---- src/qmltest/quicktestevent_p.h | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index c736a1a93a..46a395308d 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -1047,6 +1047,7 @@ Item { modifiers = Qt.NoModifier if (delay == undefined) delay = -1 + var moveDelay = Math.max(1, delay === -1 ? qtest_events.defaultMouseDelay : delay) // Divide dx and dy to have intermediate mouseMove while dragging // Fractions of dx/dy need be superior to the dragThreshold @@ -1060,12 +1061,12 @@ Item { mousePress(item, x, y, button, modifiers, delay) //trigger dragging - mouseMove(item, x + util.dragThreshold + 1, y + util.dragThreshold + 1, delay, button) + mouseMove(item, x + util.dragThreshold + 1, y + util.dragThreshold + 1, moveDelay, button) if (ddx > 0 || ddy > 0) { - mouseMove(item, x + ddx, y + ddy, delay, button) - mouseMove(item, x + 2*ddx, y + 2*ddy, delay, button) + mouseMove(item, x + ddx, y + ddy, moveDelay, button) + mouseMove(item, x + 2*ddx, y + 2*ddy, moveDelay, button) } - mouseMove(item, x + dx, y + dy, delay, button) + mouseMove(item, x + dx, y + dy, moveDelay, button) mouseRelease(item, x + dx, y + dy, button, modifiers, delay) } diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp index cfa80c4f19..e71b4f8f54 100644 --- a/src/qmltest/quicktestevent.cpp +++ b/src/qmltest/quicktestevent.cpp @@ -39,6 +39,10 @@ QT_BEGIN_NAMESPACE +namespace QTest { + extern int Q_TESTLIB_EXPORT defaultMouseDelay(); +} + QuickTestEvent::QuickTestEvent(QObject *parent) : QObject(parent) { @@ -48,6 +52,11 @@ QuickTestEvent::~QuickTestEvent() { } +int QuickTestEvent::defaultMouseDelay() const +{ + return QTest::defaultMouseDelay(); +} + bool QuickTestEvent::keyPress(int key, int modifiers, int delay) { QWindow *window = activeWindow(); @@ -105,10 +114,6 @@ bool QuickTestEvent::keyClickChar(const QString &character, int modifiers, int d return true; } -namespace QTest { - extern int Q_TESTLIB_EXPORT defaultMouseDelay(); -}; - namespace QtQuickTest { enum MouseAction { MousePress, MouseRelease, MouseClick, MouseDoubleClick, MouseMove, MouseDoubleClickSequence }; diff --git a/src/qmltest/quicktestevent_p.h b/src/qmltest/quicktestevent_p.h index 0cba644cba..0a08347db8 100644 --- a/src/qmltest/quicktestevent_p.h +++ b/src/qmltest/quicktestevent_p.h @@ -53,9 +53,11 @@ QT_BEGIN_NAMESPACE class Q_QUICK_TEST_EXPORT QuickTestEvent : public QObject { Q_OBJECT + Q_PROPERTY(int defaultMouseDelay READ defaultMouseDelay FINAL) public: QuickTestEvent(QObject *parent = 0); ~QuickTestEvent(); + int defaultMouseDelay() const; public Q_SLOTS: bool keyPress(int key, int modifiers, int delay); -- cgit v1.2.3