aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickcanvas.cpp27
-rw-r--r--src/quick/items/qquickitem.cpp8
-rw-r--r--src/quick/items/qquickitem.h3
-rw-r--r--src/quick/items/qquickitemview.cpp32
-rw-r--r--src/quick/items/qquickitemview_p_p.h3
-rw-r--r--src/quick/items/qquickpathview.cpp69
-rw-r--r--src/quick/items/qquickpathview_p.h5
-rw-r--r--src/quick/items/qquickpathview_p_p.h19
-rw-r--r--src/quick/items/qquickshadereffectsource.cpp30
-rw-r--r--src/quick/items/qquicktext.cpp17
-rw-r--r--src/quick/items/qquicktextcontrol.cpp19
-rw-r--r--src/quick/items/qquicktextcontrol_p_p.h1
-rw-r--r--src/quick/items/qquicktextinput.cpp33
-rw-r--r--src/quick/items/qquicktextinput_p_p.h1
-rw-r--r--src/quick/items/qquickwindowmanager.cpp3
-rw-r--r--src/quick/util/qquickconnections.cpp1
-rw-r--r--src/quick/util/qquickimageprovider.cpp6
17 files changed, 181 insertions, 96 deletions
diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp
index a11f68f709..2e2c8725aa 100644
--- a/src/quick/items/qquickcanvas.cpp
+++ b/src/quick/items/qquickcanvas.cpp
@@ -389,7 +389,17 @@ void QQuickCanvasPrivate::translateTouchToMouse(QTouchEvent *event)
bool doubleClick = event->timestamp() - touchMousePressTimestamp
< static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval());
touchMousePressTimestamp = event->timestamp();
+ QQuickMouseEventEx me = touchToMouseEvent(QEvent::MouseButtonPress, p);
+ me.setTimestamp(event->timestamp());
+ me.setAccepted(false);
+ me.setCapabilities(event->device()->capabilities());
+ deliverMouseEvent(&me);
+ if (me.isAccepted()) {
+ touchMouseId = p.id();
+ event->setAccepted(true);
+ }
if (doubleClick) {
+ touchMousePressTimestamp = 0;
QQuickMouseEventEx me = touchToMouseEvent(QEvent::MouseButtonDblClick, p);
me.setTimestamp(event->timestamp());
me.setAccepted(false);
@@ -407,15 +417,6 @@ void QQuickCanvasPrivate::translateTouchToMouse(QTouchEvent *event)
}
}
}
- QQuickMouseEventEx me = touchToMouseEvent(QEvent::MouseButtonPress, p);
- me.setTimestamp(event->timestamp());
- me.setAccepted(false);
- me.setCapabilities(event->device()->capabilities());
- deliverMouseEvent(&me);
- if (me.isAccepted()) {
- touchMouseId = p.id();
- event->setAccepted(true);
- }
if (touchMouseId != -1)
break;
} else if (p.id() == touchMouseId) {
@@ -531,7 +532,7 @@ void QQuickCanvasPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, F
if (oldActiveFocusItem) {
#ifndef QT_NO_IM
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
#endif
activeFocusItem = 0;
@@ -627,7 +628,7 @@ void QQuickCanvasPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
Q_ASSERT(oldActiveFocusItem);
#ifndef QT_NO_IM
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
#endif
activeFocusItem = 0;
@@ -993,6 +994,10 @@ bool QQuickCanvas::event(QEvent *e)
case QEvent::WindowDeactivate:
rootItem()->windowDeactivateEvent();
break;
+ case QEvent::FocusAboutToChange:
+ if (d->activeFocusItem)
+ qGuiApp->inputMethod()->commit();
+ break;
default:
break;
}
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 2a744c0559..1cf10df2f7 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -3067,10 +3067,6 @@ void QQuickItem::updatePolish()
{
}
-void QQuickItem::sendAccessibilityUpdate()
-{
-}
-
void QQuickItemPrivate::addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
{
changeListeners.append(ChangeListener(listener, types));
@@ -3316,6 +3312,10 @@ void QQuickItem::setBaselineOffset(qreal offset)
anchor->updateVerticalAnchors();
}
}
+
+ if (d->_anchors && (d->_anchors->usedAnchors() & QQuickAnchors::BaselineAnchor))
+ QQuickAnchorsPrivate::get(d->_anchors)->updateVerticalAnchors();
+
emit baselineOffsetChanged(offset);
}
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index 70a8ebc932..16dee80380 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -399,9 +399,6 @@ protected:
virtual void releaseResources();
virtual void updatePolish();
-protected Q_SLOTS:
- void sendAccessibilityUpdate();
-
protected:
QQuickItem(QQuickItemPrivate &dd, QQuickItem *parent = 0);
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index 0d95500860..209d30aa74 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -186,6 +186,18 @@ void QQuickItemViewChangeSet::applyChanges(const QQuickChangeSet &changeSet)
}
}
+void QQuickItemViewChangeSet::applyBufferedChanges(const QQuickItemViewChangeSet &other)
+{
+ if (!other.hasPendingChanges())
+ return;
+
+ pendingChanges.apply(other.pendingChanges);
+ itemCount = other.itemCount;
+ newCurrentIndex = other.newCurrentIndex;
+ currentChanged = other.currentChanged;
+ currentRemoved = other.currentRemoved;
+}
+
void QQuickItemViewChangeSet::prepare(int currentIndex, int count)
{
if (active)
@@ -1044,8 +1056,17 @@ void QQuickItemView::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
polish();
}
} else {
- d->currentChanges.prepare(d->currentIndex, d->itemCount);
- d->currentChanges.applyChanges(changeSet);
+ if (d->disableLayout) {
+ d->bufferedChanges.prepare(d->currentIndex, d->itemCount);
+ d->bufferedChanges.applyChanges(changeSet);
+ } else {
+ if (d->bufferedChanges.hasPendingChanges()) {
+ d->currentChanges.applyBufferedChanges(d->bufferedChanges);
+ d->bufferedChanges.reset();
+ }
+ d->currentChanges.prepare(d->currentIndex, d->itemCount);
+ d->currentChanges.applyChanges(changeSet);
+ }
polish();
}
}
@@ -1756,11 +1777,16 @@ void QQuickItemViewPrivate::layout()
bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult, ChangeResult *totalRemovalResult)
{
Q_Q(QQuickItemView);
- if (!q->isComponentComplete() || (!currentChanges.hasPendingChanges() && !runDelayedRemoveTransition) || disableLayout)
+ if (!q->isComponentComplete() || (!currentChanges.hasPendingChanges() && !bufferedChanges.hasPendingChanges() && !runDelayedRemoveTransition) || disableLayout)
return false;
disableLayout = true;
+ if (bufferedChanges.hasPendingChanges()) {
+ currentChanges.applyBufferedChanges(bufferedChanges);
+ bufferedChanges.reset();
+ }
+
updateUnrequestedIndexes();
moveReason = QQuickItemViewPrivate::Other;
diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h
index 7516761ee8..e352c461d6 100644
--- a/src/quick/items/qquickitemview_p_p.h
+++ b/src/quick/items/qquickitemview_p_p.h
@@ -107,6 +107,8 @@ public:
void applyChanges(const QQuickChangeSet &changeSet);
+ void applyBufferedChanges(const QQuickItemViewChangeSet &other);
+
int itemCount;
int newCurrentIndex;
QQuickChangeSet pendingChanges;
@@ -245,6 +247,7 @@ public:
int requestedIndex;
FxViewItem *requestedItem;
QQuickItemViewChangeSet currentChanges;
+ QQuickItemViewChangeSet bufferedChanges;
QQmlComponent *highlightComponent;
FxViewItem *highlight;
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index b85a449c51..962dddafc9 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -67,8 +67,16 @@
#define QML_FLICK_DISCARDSAMPLES 1
#endif
+// The default maximum velocity of a flick.
+#ifndef QML_FLICK_DEFAULTMAXVELOCITY
+#define QML_FLICK_DEFAULTMAXVELOCITY 2500
+#endif
+
+
QT_BEGIN_NAMESPACE
+const qreal MinimumFlickVelocity = 75.0;
+
inline qreal qmlMod(qreal x, qreal y)
{
#ifdef QT_USE_MATH_H_FLOATS
@@ -105,6 +113,23 @@ void QQuickPathViewAttached::setValue(const QByteArray &name, const QVariant &va
m_metaobject->setValue(name, val);
}
+QQuickPathViewPrivate::QQuickPathViewPrivate()
+ : path(0), currentIndex(0), currentItemOffset(0.0), startPc(0), lastDist(0)
+ , lastElapsed(0), offset(0.0), offsetAdj(0.0), mappedRange(1.0)
+ , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true)
+ , autoHighlight(true), highlightUp(false), layoutScheduled(false)
+ , moving(false), flicking(false), requestedOnPath(false), inRequest(false)
+ , dragMargin(0), deceleration(100), maximumFlickVelocity(QML_FLICK_DEFAULTMAXVELOCITY)
+ , moveOffset(this, &QQuickPathViewPrivate::setAdjustedOffset), flickDuration(0)
+ , firstIndex(-1), pathItems(-1), requestedIndex(-1), requestedZ(0)
+ , moveReason(Other), moveDirection(Shortest), attType(0), highlightComponent(0), highlightItem(0)
+ , moveHighlight(this, &QQuickPathViewPrivate::setHighlightPosition)
+ , highlightPosition(0)
+ , highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeMode(QQuickPathView::StrictlyEnforceRange)
+ , highlightMoveDuration(300), modelCount(0)
+{
+}
void QQuickPathViewPrivate::init()
{
@@ -975,6 +1000,28 @@ void QQuickPathView::setFlickDeceleration(qreal dec)
}
/*!
+ \qmlproperty real QtQuick2::PathView::maximumFlickVelocity
+ This property holds the approximate maximum velocity that the user can flick the view in pixels/second.
+
+ The default value is platform dependent.
+*/
+qreal QQuickPathView::maximumFlickVelocity() const
+{
+ Q_D(const QQuickPathView);
+ return d->maximumFlickVelocity;
+}
+
+void QQuickPathView::setMaximumFlickVelocity(qreal vel)
+{
+ Q_D(QQuickPathView);
+ if (vel == d->maximumFlickVelocity)
+ return;
+ d->maximumFlickVelocity = vel;
+ emit maximumFlickVelocityChanged();
+}
+
+
+/*!
\qmlproperty bool QtQuick2::PathView::interactive
A user cannot drag or flick a PathView that is not interactive.
@@ -1203,7 +1250,7 @@ void QQuickPathView::mousePressEvent(QMouseEvent *event)
void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event)
{
Q_Q(QQuickPathView);
- if (!interactive || !items.count())
+ if (!interactive || !items.count() || !model || !modelCount)
return;
velocityBuffer.clear();
QPointF scenePoint = q->mapToScene(event->localPos());
@@ -1252,7 +1299,7 @@ void QQuickPathView::mouseMoveEvent(QMouseEvent *event)
void QQuickPathViewPrivate::handleMouseMoveEvent(QMouseEvent *event)
{
Q_Q(QQuickPathView);
- if (!interactive || !lastPosTime.isValid())
+ if (!interactive || !lastPosTime.isValid() || !model || !modelCount)
return;
qreal newPc;
@@ -1306,14 +1353,22 @@ void QQuickPathViewPrivate::handleMouseReleaseEvent(QMouseEvent *)
Q_Q(QQuickPathView);
stealMouse = false;
q->setKeepMouseGrab(false);
- if (!interactive || !lastPosTime.isValid())
+ if (!interactive || !lastPosTime.isValid() || !model || !modelCount) {
+ lastPosTime.invalidate();
+ if (!tl.isActive())
+ q->movementEnding();
return;
+ }
qreal velocity = calcVelocity();
- if (model && modelCount && qAbs(velocity) > 0.5) {
- qreal count = pathItems == -1 ? modelCount : pathItems;
- if (qAbs(velocity) > count * 2) // limit velocity
- velocity = (velocity > 0 ? count : -count) * 2;
+ qreal count = modelCount*mappedRange;
+ qreal pixelVelocity = (path->path().length()/count) * velocity;
+ if (qAbs(pixelVelocity) > MinimumFlickVelocity) {
+ if (qAbs(pixelVelocity) > maximumFlickVelocity) {
+ // limit velocity
+ qreal maxVel = velocity < 0 ? -maximumFlickVelocity : maximumFlickVelocity;
+ velocity = maxVel / (path->path().length()/count);
+ }
// Calculate the distance to be travelled
qreal v2 = velocity*velocity;
qreal accel = deceleration/10;
diff --git a/src/quick/items/qquickpathview_p.h b/src/quick/items/qquickpathview_p.h
index 8f1ecd6caf..8b15e85b8a 100644
--- a/src/quick/items/qquickpathview_p.h
+++ b/src/quick/items/qquickpathview_p.h
@@ -73,6 +73,7 @@ class Q_AUTOTEST_EXPORT QQuickPathView : public QQuickItem
Q_PROPERTY(int highlightMoveDuration READ highlightMoveDuration WRITE setHighlightMoveDuration NOTIFY highlightMoveDurationChanged)
Q_PROPERTY(qreal dragMargin READ dragMargin WRITE setDragMargin NOTIFY dragMarginChanged)
+ Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
@@ -126,6 +127,9 @@ public:
qreal flickDeceleration() const;
void setFlickDeceleration(qreal dec);
+ qreal maximumFlickVelocity() const;
+ void setMaximumFlickVelocity(qreal);
+
bool isInteractive() const;
void setInteractive(bool);
@@ -160,6 +164,7 @@ Q_SIGNALS:
void snapPositionChanged();
void delegateChanged();
void pathItemCountChanged();
+ void maximumFlickVelocityChanged();
void flickDecelerationChanged();
void interactiveChanged();
void movingChanged();
diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h
index 412caa6d2b..ac74e9a568 100644
--- a/src/quick/items/qquickpathview_p_p.h
+++ b/src/quick/items/qquickpathview_p_p.h
@@ -74,23 +74,7 @@ class QQuickPathViewPrivate : public QQuickItemPrivate, public QQuickItemChangeL
Q_DECLARE_PUBLIC(QQuickPathView)
public:
- QQuickPathViewPrivate()
- : path(0), currentIndex(0), currentItemOffset(0.0), startPc(0), lastDist(0)
- , lastElapsed(0), offset(0.0), offsetAdj(0.0), mappedRange(1.0)
- , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true)
- , autoHighlight(true), highlightUp(false), layoutScheduled(false)
- , moving(false), flicking(false), requestedOnPath(false), inRequest(false)
- , dragMargin(0), deceleration(100)
- , moveOffset(this, &QQuickPathViewPrivate::setAdjustedOffset), flickDuration(0)
- , firstIndex(-1), pathItems(-1), requestedIndex(-1), requestedZ(0)
- , moveReason(Other), moveDirection(Shortest), attType(0), highlightComponent(0), highlightItem(0)
- , moveHighlight(this, &QQuickPathViewPrivate::setHighlightPosition)
- , highlightPosition(0)
- , highlightRangeStart(0), highlightRangeEnd(0)
- , highlightRangeMode(QQuickPathView::StrictlyEnforceRange)
- , highlightMoveDuration(300), modelCount(0)
- {
- }
+ QQuickPathViewPrivate();
void init();
@@ -169,6 +153,7 @@ public:
QPointF lastPos;
qreal dragMargin;
qreal deceleration;
+ qreal maximumFlickVelocity;
QQuickTimeLine tl;
QQuickTimeLineValueProxy<QQuickPathViewPrivate> moveOffset;
int flickDuration;
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp
index c55b1ca7f5..fffa4d9521 100644
--- a/src/quick/items/qquickshadereffectsource.cpp
+++ b/src/quick/items/qquickshadereffectsource.cpp
@@ -210,6 +210,14 @@ void QQuickShaderEffectTexture::setItem(QSGNode *item)
if (item == m_item)
return;
m_item = item;
+
+ if (m_live && !m_item) {
+ delete m_fbo;
+ delete m_secondaryFbo;
+ m_fbo = m_secondaryFbo = 0;
+ m_depthStencilBuffer.clear();
+ }
+
markDirtyTexture();
}
@@ -226,6 +234,14 @@ void QQuickShaderEffectTexture::setSize(const QSize &size)
if (size == m_size)
return;
m_size = size;
+
+ if (m_live && m_size.isNull()) {
+ delete m_fbo;
+ delete m_secondaryFbo;
+ m_fbo = m_secondaryFbo = 0;
+ m_depthStencilBuffer.clear();
+ }
+
markDirtyTexture();
}
@@ -242,6 +258,14 @@ void QQuickShaderEffectTexture::setLive(bool live)
if (live == m_live)
return;
m_live = live;
+
+ if (m_live && (!m_item || m_size.isNull())) {
+ delete m_fbo;
+ delete m_secondaryFbo;
+ m_fbo = m_secondaryFbo = 0;
+ m_depthStencilBuffer.clear();
+ }
+
markDirtyTexture();
}
@@ -613,6 +637,8 @@ void QQuickShaderEffectSource::setWrapMode(WrapMode mode)
\qmlproperty Item ShaderEffectSource::sourceItem
This property holds the element to be rendered into the texture.
+ Setting this to null while \l live is true, will release the texture
+ resources.
*/
QQuickItem *QQuickShaderEffectSource::sourceItem() const
@@ -750,8 +776,8 @@ void QQuickShaderEffectSource::setFormat(QQuickShaderEffectSource::Format format
\qmlproperty bool ShaderEffectSource::live
If this property is true, the texture is updated whenever the
- \l sourceItem changes. Otherwise, it will be a frozen image of the
- \l sourceItem. The property is true by default.
+ \l sourceItem updates. Otherwise, it will be a frozen image, even if
+ \l sourceItem is assigned a new element. The property is true by default.
*/
bool QQuickShaderEffectSource::live() const
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index d7303352c5..e1a28a466a 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -402,7 +402,7 @@ void QQuickTextPrivate::updateSize()
if (text.isEmpty()) {
qreal fontHeight = fm.height();
q->setImplicitSize(0, fontHeight);
- layedOutTextRect = QRect(0, 0, 0, fontHeight);
+ layedOutTextRect = QRectF(0, 0, 0, fontHeight);
emit q->contentSizeChanged();
updateType = UpdatePaintNode;
q->update();
@@ -2001,7 +2001,20 @@ QRectF QQuickText::boundingRect() const
// Could include font max left/right bearings to either side of rectangle.
- int h = height();
+ qreal w = width();
+ switch (d->hAlign) {
+ case AlignLeft:
+ case AlignJustify:
+ break;
+ case AlignRight:
+ rect.moveLeft(w - rect.width());
+ break;
+ case AlignHCenter:
+ rect.moveLeft((w - rect.width()) / 2);
+ break;
+ }
+
+ qreal h = height();
switch (d->vAlign) {
case AlignTop:
break;
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index 1846d03b9b..eefe938467 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -1459,7 +1459,6 @@ void QQuickTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
}
}
layout->setAdditionalFormats(overrides);
- tentativeCommit = e->tentativeCommitString();
cursor.endEditBlock();
@@ -1503,7 +1502,6 @@ void QQuickTextControlPrivate::focusEvent(QFocusEvent *e)
if (e->gotFocus()) {
setBlinkingCursorEnabled(interactionFlags & (Qt::TextEditable | Qt::TextSelectableByKeyboard));
} else {
- commitPreedit();
setBlinkingCursorEnabled(false);
if (cursorIsFocusIndicator
@@ -1732,14 +1730,12 @@ void QQuickTextControlPrivate::commitPreedit()
if (!isPreediting())
return;
- cursor.beginEditBlock();
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
- if (!tentativeCommit.isEmpty()) {
- cursor.insertText(tentativeCommit);
- tentativeCommit.clear();
- }
+ if (!isPreediting())
+ return;
+ cursor.beginEditBlock();
preeditCursor = 0;
QTextBlock block = cursor.block();
QTextLayout *layout = block.layout();
@@ -1767,17 +1763,12 @@ Qt::TextInteractionFlags QQuickTextControl::textInteractionFlags() const
QString QQuickTextControl::toPlainText() const
{
- Q_D(const QQuickTextControl);
- QString plainText = document()->toPlainText();
- if (!d->tentativeCommit.isEmpty())
- plainText.insert(textCursor().position(), d->tentativeCommit);
- return plainText;
+ return document()->toPlainText();
}
#ifndef QT_NO_TEXTHTMLPARSER
QString QQuickTextControl::toHtml() const
{
- // note: currently not including tentative commit
return document()->toHtml();
}
#endif
diff --git a/src/quick/items/qquicktextcontrol_p_p.h b/src/quick/items/qquicktextcontrol_p_p.h
index 9d776ce46b..c5a39cc759 100644
--- a/src/quick/items/qquicktextcontrol_p_p.h
+++ b/src/quick/items/qquicktextcontrol_p_p.h
@@ -137,7 +137,6 @@ public:
QTextCursor cursor;
QTextCursor selectedWordOnDoubleClick;
QTextCursor selectedBlockOnTrippleClick;
- QString tentativeCommit;
QString highlightedAnchor; // Anchor below cursor
QString anchorOnMousePress;
QString linkToCopy;
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 94856b63ab..f2da67bae7 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -119,8 +119,6 @@ QString QQuickTextInput::text() const
Q_D(const QQuickTextInput);
QString content = d->m_text;
- if (!d->m_tentativeCommit.isEmpty())
- content.insert(d->m_cursor, d->m_tentativeCommit);
QString res = d->m_maskData ? d->stripString(content) : content;
return (res.isNull() ? QString::fromLatin1("") : res);
}
@@ -132,7 +130,6 @@ void QQuickTextInput::setText(const QString &s)
return;
if (d->composeMode())
qApp->inputMethod()->reset();
- d->m_tentativeCommit.clear();
d->internalSetText(s, -1, false);
}
@@ -2496,7 +2493,6 @@ void QQuickTextInput::itemChange(ItemChange change, const ItemChangeData &value)
}
if (!hasFocus) {
- d->commitPreedit();
if (!d->persistentSelection)
d->deselect();
disconnect(qApp->inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
@@ -2831,21 +2827,16 @@ void QQuickTextInputPrivate::paste(QClipboard::Mode clipboardMode)
/*!
\internal
-
- Exits preedit mode and commits parts marked as tentative commit
*/
void QQuickTextInputPrivate::commitPreedit()
{
if (!composeMode())
return;
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
- if (!m_tentativeCommit.isEmpty()) {
- internalInsert(m_tentativeCommit);
- m_tentativeCommit.clear();
- finishChange(-1, true/*not used, not documented*/, false);
- }
+ if (!composeMode())
+ return;
m_preeditCursor = 0;
m_textLayout.setPreeditArea(-1, QString());
@@ -3160,14 +3151,7 @@ void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event)
q->updateCursorRectangle();
}
- bool tentativeCommitChanged = m_tentativeCommit != event->tentativeCommitString();
-
- if (tentativeCommitChanged) {
- m_textDirty = true;
- m_tentativeCommit = event->tentativeCommitString();
- }
-
- if (isGettingInput || tentativeCommitChanged)
+ if (isGettingInput)
finishChange(priorState);
if (selectionChange) {
@@ -3237,15 +3221,6 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
return true;
}
m_cursor = cursorCopy;
-
- if (!m_tentativeCommit.isEmpty()) {
- textCopy.insert(m_cursor, m_tentativeCommit);
- bool validInput = m_validator->validate(textCopy, cursorCopy) != QValidator::Invalid;
- if (!validInput)
- m_tentativeCommit.clear();
- }
- } else {
- m_tentativeCommit.clear();
}
}
#endif
diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h
index 165155acd0..3bd34b2661 100644
--- a/src/quick/items/qquicktextinput_p_p.h
+++ b/src/quick/items/qquicktextinput_p_p.h
@@ -188,7 +188,6 @@ public:
QString m_text;
QString m_inputMask;
QString m_cancelText;
- QString m_tentativeCommit;
QFont font;
QFont sourceFont;
diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp
index 61c2ef24b4..bac5cc7582 100644
--- a/src/quick/items/qquickwindowmanager.cpp
+++ b/src/quick/items/qquickwindowmanager.cpp
@@ -1120,7 +1120,8 @@ void QQuickRenderThreadSingleContextWindowManager::maybeUpdate(QQuickCanvas *)
void QQuickRenderThreadSingleContextWindowManager::wakeup()
{
lockInGui();
- if (isRenderBlocked)
+ isExternalUpdatePending = true;
+ if (isRenderBlocked || isPostingSyncEvent)
wake();
unlockInGui();
}
diff --git a/src/quick/util/qquickconnections.cpp b/src/quick/util/qquickconnections.cpp
index 533c7013ef..acc9738f2c 100644
--- a/src/quick/util/qquickconnections.cpp
+++ b/src/quick/util/qquickconnections.cpp
@@ -283,6 +283,7 @@ void QQuickConnections::connectSignals()
QQmlExpression *expression = ctxtdata ?
QQmlExpressionPrivate::create(ctxtdata, 0, script, true, location, line, column) : 0;
signal->setExpression(expression);
+ signal->addToObject();
d->boundsignals += signal;
} else {
if (!d->ignoreUnknownSignals)
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index 1d838cac32..b306ab3419 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -53,6 +53,7 @@ public:
\class QQuickTextureFactory
\since 5.0
\brief The QQuickTextureFactory class provides an interface for loading custom textures from QML.
+ \inmodule QtQml
The purpose of the texture factory is to provide a placeholder for a image
data that can be converted into an OpenGL texture.
@@ -110,7 +111,8 @@ QImage QQuickTextureFactory::image() const
/*!
\class QQuickImageProvider
- \since 4.7
+ \since 5.0
+ \inmodule QtQuick
\brief The QQuickImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML.
QQuickImageProvider is used to provide advanced image loading features
@@ -218,6 +220,8 @@ QImage QQuickTextureFactory::image() const
\c cache property to \c false for the relevant \l Image, \l BorderImage or
\l AnimatedImage object.
+ The QtQuick 1 version of this class is named QDeclarativeImageProvider.
+
\sa QQmlEngine::addImageProvider()
*/