aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-16 23:21:10 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-16 23:21:16 +0200
commit345226aa3ecee8642c3bf46e40c981d4a49d958e (patch)
treeeb49f01c70d239286cb3f08bbe677c47c640cd12 /src/quick
parent5149aa68eca6ede8836ec4f07a14d22d9da9b161 (diff)
parenta273a0ad9c1df7aed612ee6353753f668d545076 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/doc/src/concepts/input/focus.qdoc2
-rw-r--r--src/quick/items/qquickdrag.cpp2
-rw-r--r--src/quick/items/qquicktextinput.cpp7
-rw-r--r--src/quick/items/qquickwindow.cpp9
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode.cpp4
5 files changed, 19 insertions, 5 deletions
diff --git a/src/quick/doc/src/concepts/input/focus.qdoc b/src/quick/doc/src/concepts/input/focus.qdoc
index db84961d20..ec4e4ca2d9 100644
--- a/src/quick/doc/src/concepts/input/focus.qdoc
+++ b/src/quick/doc/src/concepts/input/focus.qdoc
@@ -117,7 +117,7 @@ the focus, but it cannot control the focus when it is imported or reused.
Likewise, the \c window component does not have the ability to know if its
imported components are requesting the focus.
-To solve this problem, the QML introduces a concept known as a \e {focus scope}.
+To solve this problem, QML introduces a concept known as a \e {focus scope}.
For existing Qt users, a focus scope is like an automatic focus proxy.
A focus scope is created by declaring the \l FocusScope type.
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index 9a24d7a8a0..558f52a1af 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -720,7 +720,7 @@ Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedAct
{
Q_Q(QQuickDragAttached);
- QDrag *drag = new QDrag(q);
+ QDrag *drag = new QDrag(source ? source : q);
QMimeData *mimeData = new QMimeData();
for (auto it = externalMimeData.cbegin(), end = externalMimeData.cend(); it != end; ++it)
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 3037ad8bdd..168fd0d9b6 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -4280,8 +4280,13 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
if (!(q->inputMethodHints() & Qt::ImhMultiLine))
inputMethod->hide();
+ if (activeFocus) {
+ // If we lost focus after hiding the virtual keyboard, we've already emitted
+ // editingFinished from handleFocusEvent. Otherwise we emit it now.
+ emit q->editingFinished();
+ }
+
emit q->accepted();
- emit q->editingFinished();
}
event->ignore();
return;
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 46ae993a18..10e439182d 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1482,6 +1482,15 @@ bool QQuickWindow::event(QEvent *e)
// return in order to avoid the QWindow::event below
return d->deliverTouchCancelEvent(static_cast<QTouchEvent*>(e));
break;
+ case QEvent::Enter: {
+ QEnterEvent *enter = static_cast<QEnterEvent*>(e);
+ bool accepted = enter->isAccepted();
+ bool delivered = d->deliverHoverEvent(d->contentItem, enter->windowPos(), d->lastMousePosition,
+ QGuiApplication::keyboardModifiers(), 0L, accepted);
+ enter->setAccepted(accepted);
+ return delivered;
+ }
+ break;
case QEvent::Leave:
d->clearHover();
d->lastMousePosition = QPoint();
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
index e56f586c90..3e5ed72d0f 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
@@ -224,7 +224,7 @@ void QSGDefaultPainterNode::updateGeometry()
if (m_actualRenderTarget == QQuickPaintedItem::Image)
source = QRectF(0, 0, 1, 1);
else
- source = QRectF(0, 0, qreal(m_size.width()) / m_fboSize.width(), qreal(m_size.height()) / m_fboSize.height());
+ source = QRectF(0, 0, qreal(m_textureSize.width()) / m_fboSize.width(), qreal(m_textureSize.height()) / m_fboSize.height());
QRectF dest(0, 0, m_size.width(), m_size.height());
if (m_actualRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject)
dest = QRectF(QPointF(0, m_size.height()), QPointF(m_size.width(), 0));
@@ -306,7 +306,7 @@ void QSGDefaultPainterNode::updateRenderTarget()
QSGPainterTexture *texture = new QSGPainterTexture;
if (m_actualRenderTarget == QQuickPaintedItem::Image) {
texture->setOwnsTexture(true);
- texture->setTextureSize(m_size);
+ texture->setTextureSize(m_textureSize);
} else {
texture->setTextureId(m_fbo->texture());
texture->setOwnsTexture(false);