diff options
author | Liang Qi <liang.qi@qt.io> | 2016-08-03 07:58:19 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-08-03 10:23:11 +0200 |
commit | e9855d8ac8afed5371330f4f83f7b7dd51d9026f (patch) | |
tree | c1f70cbc64d9fe5d07911601880c571b4d3cd8f0 /src/quicktemplates2 | |
parent | 508bb6ddde831fb0d0b7065b39d99be01b4e4771 (diff) | |
parent | 1b7b2d7ddb6a02fd2ccd1f29a431005b9e693723 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Also update expected line numbers in tst_swipedelegate.
Conflicts:
.qmake.conf
src/quicktemplates2/qquicktextarea.cpp
src/quicktemplates2/qquicktextarea_p.h
tests/auto/controls/data/tst_swipedelegate.qml
Change-Id: I36323e3a633c1c750d23014e56a7c881963a1a30
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickswipedelegate.cpp | 16 | ||||
-rw-r--r-- | src/quicktemplates2/qquicktextarea.cpp | 8 | ||||
-rw-r--r-- | src/quicktemplates2/qquicktextarea_p.h | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index 6cd7abf4..d266ca86 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -750,8 +750,24 @@ bool QQuickSwipeDelegatePrivate::handleMouseReleaseEvent(QQuickItem *item, QMous return hadGrabbedMouse; } +static void warnIfHorizontallyAnchored(QQuickItem *item, const QString &itemName) +{ + if (!item) + return; + + QQuickAnchors *anchors = QQuickItemPrivate::get(item)->_anchors; + if (anchors && (anchors->fill() || anchors->centerIn() || anchors->left().item || anchors->right().item) + && !item->property("_q_QQuickSwipeDelegate_warned").toBool()) { + qmlInfo(item) << QString::fromLatin1("SwipeDelegate: cannot use horizontal anchors with %1; unable to layout the item.").arg(itemName); + item->setProperty("_q_QQuickSwipeDelegate_warned", true); + } +} + void QQuickSwipeDelegatePrivate::resizeContent() { + warnIfHorizontallyAnchored(background, QStringLiteral("background")); + warnIfHorizontallyAnchored(contentItem, QStringLiteral("contentItem")); + // If the background and contentItem are repositioned due to a swipe, // we don't want to call QQuickControlPrivate's implementation of this function, // as it repositions the contentItem to be visible. diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index 754f59f7..0f78413e 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -545,6 +545,14 @@ void QQuickTextArea::setHoverEnabled(bool enabled) emit hoverEnabledChanged(); } +bool QQuickTextArea::contains(const QPointF &point) const +{ + Q_D(const QQuickTextArea); + if (d->flickable && !d->flickable->contains(d->flickable->mapFromItem(this, point))) + return false; + return QQuickTextEdit::contains(point); +} + void QQuickTextArea::classBegin() { Q_D(QQuickTextArea); diff --git a/src/quicktemplates2/qquicktextarea_p.h b/src/quicktemplates2/qquicktextarea_p.h index 56346514..20500ee6 100644 --- a/src/quicktemplates2/qquicktextarea_p.h +++ b/src/quicktemplates2/qquicktextarea_p.h @@ -94,6 +94,8 @@ public: bool isHoverEnabled() const; void setHoverEnabled(bool enabled); + bool contains(const QPointF &point) const override; + Q_SIGNALS: void fontChanged(); void implicitWidthChanged3(); |