aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-11-21 11:34:57 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-11-22 09:50:11 +0100
commitaa3813366a8e772cd58c9253461cf2dc50b97a9d (patch)
treee306a60fa9b2d1f7dd2e6b245fdf05214c7c55df /src/imports
parent4241bb4d26ef69eb212e0274bad0926ec71bead9 (diff)
parentacb6ed0815f92588c3ff875a568e9561fe61218c (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/qml/qml/qqmlextensionplugin.cpp tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: Ic58d36a8532015bae30f2690063db9829b3bf372
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/labsmodels/plugin.cpp2
-rw-r--r--src/imports/layouts/qquicklinearlayout.cpp18
-rw-r--r--src/imports/models/plugin.cpp17
-rw-r--r--src/imports/testlib/TestCase.qml8
4 files changed, 39 insertions, 6 deletions
diff --git a/src/imports/labsmodels/plugin.cpp b/src/imports/labsmodels/plugin.cpp
index f1d1dd20b0..8458133c79 100644
--- a/src/imports/labsmodels/plugin.cpp
+++ b/src/imports/labsmodels/plugin.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
\qmlmodule Qt.labs.qmlmodels 1.0
\title Qt QML Models experimental QML Types
\ingroup qmlmodules
- \brief Provides QML experimental types for data models
+ \brief Provides QML experimental types for data models.
\since 5.12
This QML module contains experimental QML types related to data models.
diff --git a/src/imports/layouts/qquicklinearlayout.cpp b/src/imports/layouts/qquicklinearlayout.cpp
index 2e3b12064b..c8d2ac5eb2 100644
--- a/src/imports/layouts/qquicklinearlayout.cpp
+++ b/src/imports/layouts/qquicklinearlayout.cpp
@@ -645,6 +645,7 @@ void QQuickGridLayout::insertLayoutItems()
int &nextColumn = nextCellPos[0];
int &nextRow = nextCellPos[1];
+ const QSize gridSize(columns(), rows());
const int flowOrientation = flow();
int &flowColumn = nextCellPos[flowOrientation];
int &flowRow = nextCellPos[1 - flowOrientation];
@@ -677,8 +678,21 @@ void QQuickGridLayout::insertLayoutItems()
// the unspecified component of the cell position should default to 0
// The getters do this for us, as they will return 0 for an
// unset (or negative) value.
- row = info->row();
- column = info->column();
+ // In addition, if \a rows is less than Layout.row, treat Layout.row as if it was not set
+ // This will basically make it find the next available cell (potentially wrapping to
+ // the next line). Likewise for an invalid Layout.column
+
+ if (gridSize.height() >= 0 && row >= gridSize.height()) {
+ qmlWarning(child) << QString::fromLatin1("Layout: row (%1) should be less than the number of rows (%2)").arg(info->row()).arg(rows());
+ } else {
+ row = info->row();
+ }
+
+ if (gridSize.width() >= 0 && info->column() >= gridSize.width()) {
+ qmlWarning(child) << QString::fromLatin1("Layout: column (%1) should be less than the number of columns (%2)").arg(info->column()).arg(columns());
+ } else {
+ column = info->column();
+ }
}
rowSpan = info->rowSpan();
columnSpan = info->columnSpan();
diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp
index 9fe63412f3..319321013e 100644
--- a/src/imports/models/plugin.cpp
+++ b/src/imports/models/plugin.cpp
@@ -59,8 +59,23 @@ QT_BEGIN_NAMESPACE
import QtQml.Models 2.\1
\endqml
- Note that QtQml.Models module started at version 2.1 to match the version
+ \note QtQml.Models module started at version 2.1 to match the version
of the parent module, \l{Qt QML}.
+
+ In addition, Qt.labs.qmlmodels provides experimental QML types for models.
+ To use these experimental types, import the module with the following line:
+
+ \qml
+ import Qt.labs.qmlmodels 1.0
+ \endqml
+
+ \section1 QML Types
+ \generatelist qmltypesbymodule QtQml.Models
+
+ \section1 Experimental QML Types
+ \generatelist qmltypesbymodule Qt.labs.qmlmodels
+
+ \noautolist
*/
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 6e075d8792..fff375b49a 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -1425,8 +1425,12 @@ Item {
ddy = 0
mousePress(item, x, y, button, modifiers, delay)
- //trigger dragging
- mouseMove(item, x + util.dragThreshold + 1, y + util.dragThreshold + 1, moveDelay, button)
+
+ // Trigger dragging by dragging past the drag threshold, but making sure to only drag
+ // along a certain axis if a distance greater than zero was given for that axis.
+ var dragTriggerXDistance = dx > 0 ? (util.dragThreshold + 1) : 0
+ var dragTriggerYDistance = dy > 0 ? (util.dragThreshold + 1) : 0
+ mouseMove(item, x + dragTriggerXDistance, y + dragTriggerYDistance, moveDelay, button)
if (ddx > 0 || ddy > 0) {
mouseMove(item, x + ddx, y + ddy, moveDelay, button)
mouseMove(item, x + 2*ddx, y + 2*ddy, moveDelay, button)