aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-18 10:29:10 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-18 10:29:47 +0200
commiteb30e3d7ee81c48cea720e7ecd2ed45647bc70ee (patch)
tree810e8ad0642434eeb4043c3a06c82217314300e1 /src/quick/items
parent9c9fca5e27bd91da1ea07bebd7569049493c5ccf (diff)
parent521ace713d8e5230d47f3da8cd941699ca085af2 (diff)
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp6
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp8
-rw-r--r--src/quick/items/qquickdrag.cpp2
-rw-r--r--src/quick/items/qquickevents.cpp2
-rw-r--r--src/quick/items/qquickflickable.cpp47
-rw-r--r--src/quick/items/qquickflickable_p_p.h3
-rw-r--r--src/quick/items/qquickframebufferobject.cpp9
-rw-r--r--src/quick/items/qquickgridview.cpp8
-rw-r--r--src/quick/items/qquickimage_p.h2
-rw-r--r--src/quick/items/qquickitem.cpp25
-rw-r--r--src/quick/items/qquickitemview_p_p.h2
-rw-r--r--src/quick/items/qquicklistview.cpp8
-rw-r--r--src/quick/items/qquickpainteditem.cpp9
-rw-r--r--src/quick/items/qquickrendercontrol.cpp4
-rw-r--r--src/quick/items/qquicktext.cpp5
-rw-r--r--src/quick/items/qquicktext_p_p.h1
-rw-r--r--src/quick/items/qquicktextcontrol.cpp2
-rw-r--r--src/quick/items/qquicktextedit.cpp7
-rw-r--r--src/quick/items/qquicktextinput.cpp2
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp16
-rw-r--r--src/quick/items/qquickwindow.cpp5
21 files changed, 117 insertions, 56 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 8fa290b953..9932747dd3 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -57,7 +57,11 @@ class QQuickCanvasNode : public QSGSimpleTextureNode
public:
QQuickCanvasNode() {
qsgnode_set_description(this, QStringLiteral("canvasnode"));
- setOwnsTexture(true);
+ setOwnsTexture(false);
+ }
+
+ ~QQuickCanvasNode() {
+ delete texture();
}
};
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
index 782d03f9f9..4a2c137aa1 100644
--- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
+++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
@@ -92,7 +92,7 @@ namespace {
{
}
- void paint(QPainter *p) const { p->fillRect(m_rect, m_brush); }
+ void paint(QPainter *p) const Q_DECL_OVERRIDE { p->fillRect(m_rect, m_brush); }
QRectF boundingRect() const Q_DECL_OVERRIDE { return m_rect; }
private:
@@ -109,7 +109,7 @@ namespace {
{
}
- void paint(QPainter *p) const { p->fillPath(m_path, m_brush); }
+ void paint(QPainter *p) const Q_DECL_OVERRIDE { p->fillPath(m_path, m_brush); }
QRectF boundingRect() const Q_DECL_OVERRIDE { return m_path.boundingRect(); }
private:
@@ -126,7 +126,7 @@ namespace {
{
}
- void paint(QPainter *p) const { p->strokePath(m_path, m_pen); }
+ void paint(QPainter *p) const Q_DECL_OVERRIDE { p->strokePath(m_path, m_pen); }
QRectF boundingRect() const Q_DECL_OVERRIDE
{
@@ -148,7 +148,7 @@ namespace {
{
}
- void paint(QPainter *p) const { p->drawImage(m_offset, m_image); }
+ void paint(QPainter *p) const Q_DECL_OVERRIDE { p->drawImage(m_offset, m_image); }
QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(m_image.rect()).translated(m_offset); }
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index 4d46485718..2612b855bd 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -75,7 +75,7 @@ public:
}
void itemGeometryChanged(QQuickItem *, const QRectF &, const QRectF &) Q_DECL_OVERRIDE;
- void itemParentChanged(QQuickItem *, QQuickItem *parent);
+ void itemParentChanged(QQuickItem *, QQuickItem *parent) Q_DECL_OVERRIDE;
void updatePosition();
void restartDrag();
void deliverEnterEvent();
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index 3ce4a8cb49..1380452718 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -323,7 +323,7 @@ Item {
\qmlproperty point QtQuick::WheelEvent::pixelDelta
This property holds the delta in screen pixels and is available in plataforms that
- have high-resolution trackpads, such as Mac OS X.
+ have high-resolution trackpads, such as OS X.
The x and y cordinate of this property holds the delta in horizontal and
vertical orientation. The value should be used directly to scroll content on screen.
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index fc4a3efb8e..ea4398bc71 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1004,7 +1004,8 @@ void QQuickFlickablePrivate::maybeBeginDrag(qint64 currentTimestamp, const QPoin
}
void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventType, const QPointF &localPos,
- const QVector2D &deltas, bool overThreshold, bool momentum, const QVector2D &velocity)
+ const QVector2D &deltas, bool overThreshold, bool momentum,
+ bool velocitySensitiveOverBounds, const QVector2D &velocity)
{
Q_Q(QQuickFlickable);
bool rejectY = false;
@@ -1061,9 +1062,13 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
}
return;
}
- qreal overshoot = (newY - minY) * vData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
- overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
- newY = minY + overshoot;
+ if (velocitySensitiveOverBounds) {
+ qreal overshoot = (newY - minY) * vData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
+ overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
+ newY = minY + overshoot;
+ } else {
+ newY = minY + (newY - minY) / 2;
+ }
} else if (newY < maxY && maxY - minY <= 0) {
// Overshoot beyond the bottom. But don't wait for momentum phase to end before returning to bounds.
if (momentum && vData.atEnd) {
@@ -1073,9 +1078,13 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
}
return;
}
- qreal overshoot = (newY - maxY) * vData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
- overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
- newY = maxY - overshoot;
+ if (velocitySensitiveOverBounds) {
+ qreal overshoot = (newY - maxY) * vData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
+ overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
+ newY = maxY - overshoot;
+ } else {
+ newY = maxY + (newY - maxY) / 2;
+ }
}
}
if (!rejectY && stealMouse && dy != 0.0 && dy != vData.previousDragDelta) {
@@ -1126,9 +1135,13 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
}
return;
}
- qreal overshoot = (newX - minX) * hData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
- overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
- newX = minX + overshoot;
+ if (velocitySensitiveOverBounds) {
+ qreal overshoot = (newX - minX) * hData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
+ overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
+ newX = minX + overshoot;
+ } else {
+ newX = minX + (newX - minX) / 2;
+ }
} else if (newX < maxX && maxX - minX <= 0) {
// Overshoot beyond the right. But don't wait for momentum phase to end before returning to bounds.
if (momentum && hData.atEnd) {
@@ -1138,9 +1151,13 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
}
return;
}
- qreal overshoot = (newX - maxX) * hData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
- overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
- newX = maxX - overshoot;
+ if (velocitySensitiveOverBounds) {
+ qreal overshoot = (newX - maxX) * hData.velocity / QML_FLICK_DEFAULTMAXVELOCITY / QML_FLICK_OVERSHOOTFRICTION;
+ overshoot = QML_FLICK_OVERSHOOT * devicePixelRatio() * EaseOvershoot(overshoot / QML_FLICK_OVERSHOOT / devicePixelRatio());
+ newX = maxX - overshoot;
+ } else {
+ newX = maxX + (newX - maxX) / 2;
+ }
}
}
@@ -1210,7 +1227,7 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
if (q->xflick())
overThreshold |= QQuickWindowPrivate::dragOverThreshold(deltas.x(), Qt::XAxis, event);
- drag(currentTimestamp, event->type(), event->localPos(), deltas, overThreshold, false, velocity);
+ drag(currentTimestamp, event->type(), event->localPos(), deltas, overThreshold, false, false, velocity);
}
void QQuickFlickablePrivate::handleMouseReleaseEvent(QMouseEvent *event)
@@ -1433,7 +1450,7 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
QVector2D velocity(xDelta / elapsed, yDelta / elapsed);
d->lastPosTime = currentTimestamp;
d->accumulatedWheelPixelDelta += QVector2D(event->pixelDelta());
- d->drag(currentTimestamp, event->type(), event->posF(), d->accumulatedWheelPixelDelta, true, !d->scrollingPhase, velocity);
+ d->drag(currentTimestamp, event->type(), event->posF(), d->accumulatedWheelPixelDelta, true, !d->scrollingPhase, true, velocity);
event->accept();
}
diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h
index d7148ca57a..65bb3e802d 100644
--- a/src/quick/items/qquickflickable_p_p.h
+++ b/src/quick/items/qquickflickable_p_p.h
@@ -250,7 +250,8 @@ public:
void maybeBeginDrag(qint64 currentTimestamp, const QPointF &pressPosn);
void drag(qint64 currentTimestamp, QEvent::Type eventType, const QPointF &localPos,
- const QVector2D &deltas, bool overThreshold, bool momentum, const QVector2D &velocity);
+ const QVector2D &deltas, bool overThreshold, bool momentum,
+ bool velocitySensitiveOverBounds, const QVector2D &velocity);
qint64 computeCurrentTime(QInputEvent *event);
qreal devicePixelRatio();
diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp
index 18e786fea4..74abd8cf9f 100644
--- a/src/quick/items/qquickframebufferobject.cpp
+++ b/src/quick/items/qquickframebufferobject.cpp
@@ -329,11 +329,17 @@ QSGNode *QQuickFramebufferObject::updatePaintNode(QSGNode *node, UpdatePaintNode
return n;
}
+/*!
+ \reimp
+*/
bool QQuickFramebufferObject::isTextureProvider() const
{
return true;
}
+/*!
+ \reimp
+*/
QSGTextureProvider *QQuickFramebufferObject::textureProvider() const
{
Q_D(const QQuickFramebufferObject);
@@ -347,6 +353,9 @@ QSGTextureProvider *QQuickFramebufferObject::textureProvider() const
return d->node;
}
+/*!
+ \reimp
+*/
void QQuickFramebufferObject::releaseResources()
{
// When release resources is called on the GUI thread, we only need to
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
index ff928a599f..3ac9c6eb1c 100644
--- a/src/quick/items/qquickgridview.cpp
+++ b/src/quick/items/qquickgridview.cpp
@@ -60,19 +60,19 @@ public:
{
}
- qreal position() const {
+ qreal position() const Q_DECL_OVERRIDE {
return rowPos();
}
- qreal endPosition() const {
+ qreal endPosition() const Q_DECL_OVERRIDE {
return endRowPos();
}
- qreal size() const {
+ qreal size() const Q_DECL_OVERRIDE {
return view->flow() == QQuickGridView::FlowLeftToRight ? view->cellHeight() : view->cellWidth();
}
- qreal sectionSize() const {
+ qreal sectionSize() const Q_DECL_OVERRIDE {
return 0.0;
}
diff --git a/src/quick/items/qquickimage_p.h b/src/quick/items/qquickimage_p.h
index a780f9a626..421360bd35 100644
--- a/src/quick/items/qquickimage_p.h
+++ b/src/quick/items/qquickimage_p.h
@@ -88,7 +88,7 @@ public:
bool mipmap() const;
void setMipmap(bool use);
- virtual void emitAutoTransformBaseChanged() { emit autoTransformChanged(); }
+ virtual void emitAutoTransformBaseChanged() Q_DECL_OVERRIDE { emit autoTransformChanged(); }
Q_SIGNALS:
void fillModeChanged();
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 22290d4fc1..32c3e651dd 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -4321,7 +4321,6 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const
/*!
\qmlmethod QtQuick::Item::forceActiveFocus()
- \overload
Forces active focus on the item.
@@ -4334,6 +4333,18 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const
\sa activeFocus
*/
+/*!
+ Forces active focus on the item.
+
+ This method sets focus on the item and ensures that all ancestor
+ FocusScope objects in the object hierarchy are also given \l focus.
+
+ The reason for the focus change will be \l [CPP] Qt::OtherFocusReason. Use
+ the overloaded method to specify the focus reason to enable better
+ handling of the focus change.
+
+ \sa activeFocus
+*/
void QQuickItem::forceActiveFocus()
{
forceActiveFocus(Qt::OtherFocusReason);
@@ -4341,7 +4352,19 @@ void QQuickItem::forceActiveFocus()
/*!
\qmlmethod QtQuick::Item::forceActiveFocus(Qt::FocusReason reason)
+ \overload
+
+ Forces active focus on the item with the given \a reason.
+
+ This method sets focus on the item and ensures that all ancestor
+ FocusScope objects in the object hierarchy are also given \l focus.
+ \since 5.1
+
+ \sa activeFocus, Qt::FocusReason
+*/
+/*!
+ \overload
Forces active focus on the item with the given \a reason.
This method sets focus on the item and ensures that all ancestor
diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h
index f535963fdb..0931db4e56 100644
--- a/src/quick/items/qquickitemview_p_p.h
+++ b/src/quick/items/qquickitemview_p_p.h
@@ -180,7 +180,7 @@ public:
void regenerate(bool orientationChanged=false);
void layout();
- virtual void animationFinished(QAbstractAnimationJob *);
+ virtual void animationFinished(QAbstractAnimationJob *) Q_DECL_OVERRIDE;
void refill();
void refill(qreal from, qreal to);
void mirrorChange() Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index b08a8cfffe..a1d765d6ec 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -255,7 +255,7 @@ public:
static_cast<QQuickListViewAttached*>(attached)->m_sectionItem = s;
}
- qreal position() const {
+ qreal position() const Q_DECL_OVERRIDE {
if (section()) {
if (view->orientation() == QQuickListView::Vertical)
return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop ? -section()->height()-section()->y() : section()->y());
@@ -271,7 +271,7 @@ public:
else
return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -itemWidth()-itemX() : itemX());
}
- qreal size() const {
+ qreal size() const Q_DECL_OVERRIDE {
if (section())
return (view->orientation() == QQuickListView::Vertical ? itemHeight()+section()->height() : itemWidth()+section()->width());
else
@@ -280,12 +280,12 @@ public:
qreal itemSize() const {
return (view->orientation() == QQuickListView::Vertical ? itemHeight() : itemWidth());
}
- qreal sectionSize() const {
+ qreal sectionSize() const Q_DECL_OVERRIDE {
if (section())
return (view->orientation() == QQuickListView::Vertical ? section()->height() : section()->width());
return 0.0;
}
- qreal endPosition() const {
+ qreal endPosition() const Q_DECL_OVERRIDE {
if (view->orientation() == QQuickListView::Vertical) {
return (view->verticalLayoutDirection() == QQuickItemView::BottomToTop
? -itemY()
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index b3e4906c41..8d93c577ab 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -549,6 +549,9 @@ QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDat
return node;
}
+/*!
+ \reimp
+*/
void QQuickPaintedItem::releaseResources()
{
Q_D(QQuickPaintedItem);
@@ -567,11 +570,17 @@ void QQuickPaintedItem::invalidateSceneGraph()
d->node = 0; // Managed by the scene graph, just clear the pointer
}
+/*!
+ \reimp
+*/
bool QQuickPaintedItem::isTextureProvider() const
{
return true;
}
+/*!
+ \reimp
+*/
QSGTextureProvider *QQuickPaintedItem::textureProvider() const
{
Q_D(const QQuickPaintedItem);
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index e81edecde9..cc4cec443a 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -140,6 +140,10 @@ void QQuickRenderControlPrivate::cleanup()
sg = 0;
}
+/*!
+ Constructs a QQuickRenderControl object, with parent
+ object \a parent.
+*/
QQuickRenderControl::QQuickRenderControl(QObject *parent)
: QObject(*(new QQuickRenderControlPrivate), parent)
{
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index a91e6b47c2..924c455872 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -100,6 +100,7 @@ QQuickTextPrivate::ExtraData::ExtraData()
, minimumPointSize(12)
, nbActiveDownloads(0)
, maximumLineCount(INT_MAX)
+ , lineHeightValid(false)
, lineHeightMode(QQuickText::ProportionalHeight)
, fontSizeMode(QQuickText::FixedSize)
{
@@ -421,7 +422,7 @@ void QQuickTextPrivate::updateLayout()
}
textHasChanged = false;
}
- } else {
+ } else if (extra.isAllocated() && extra->lineHeightValid) {
ensureDoc();
QTextBlockFormat::LineHeightTypes type;
type = lineHeightMode() == QQuickText::FixedHeight ? QTextBlockFormat::FixedHeight : QTextBlockFormat::ProportionalHeight;
@@ -2480,6 +2481,7 @@ void QQuickText::setLineHeight(qreal lineHeight)
if ((d->lineHeight() == lineHeight) || (lineHeight < 0.0))
return;
+ d->extra.value().lineHeightValid = true;
d->extra.value().lineHeight = lineHeight;
d->implicitHeightValid = false;
d->updateLayout();
@@ -2511,6 +2513,7 @@ void QQuickText::setLineHeightMode(LineHeightMode mode)
return;
d->implicitHeightValid = false;
+ d->extra.value().lineHeightValid = true;
d->extra.value().lineHeightMode = mode;
d->updateLayout();
diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h
index f0469fc8ea..f43df691b5 100644
--- a/src/quick/items/qquicktext_p_p.h
+++ b/src/quick/items/qquicktext_p_p.h
@@ -104,6 +104,7 @@ public:
int minimumPointSize;
int nbActiveDownloads;
int maximumLineCount;
+ bool lineHeightValid : 1;
QQuickText::LineHeightMode lineHeightMode;
QQuickText::FontSizeMode fontSizeMode;
QList<QQuickStyledTextImgTag*> imgTags;
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index 19cdc388f1..7bc5fab677 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -225,7 +225,7 @@ bool QQuickTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
return false;
}
-// Except for pageup and pagedown, Mac OS X has very different behavior, we don't do it all, but
+// Except for pageup and pagedown, OS X has very different behavior, we don't do it all, but
// here's the breakdown:
// Shift still works as an anchor, but only one of the other keys can be down Ctrl (Command),
// Alt (Option), or Meta (Control).
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index cf7e91ffec..dc4e301a36 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -1961,13 +1961,6 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
engine.addTextObject(QPointF(0, 0), format, QQuickTextNodeEngine::Unselected, d->document,
pos, textFrame->frameFormat().position());
nodeStart = pos;
- } else if (qobject_cast<QTextTable*>(textFrame)) { // To keep things simple, map text tables as one text node
- QTextFrame::iterator it = textFrame->begin();
- nodeOffset = d->document->documentLayout()->frameBoundingRect(textFrame).topLeft();
- updateNodeTransform(node, nodeOffset);
- while (!it.atEnd())
- engine.addTextBlock(d->document, (it++).currentBlock(), -nodeOffset, d->color, QColor(), selectionStart(), selectionEnd() - 1);
- nodeStart = textFrame->firstPosition();
} else {
// Having nodes spanning across frame boundaries will break the current bookkeeping mechanism. We need to prevent that.
QList<int> frameBoundaries;
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 31549451ab..c29acf3c83 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -78,7 +78,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
and setting \l echoMode to an appropriate value enables TextInput to be used for
a password input field.
- On Mac OS X, the Up/Down key bindings for Home/End are explicitly disabled.
+ On OS X, the Up/Down key bindings for Home/End are explicitly disabled.
If you want such bindings (on any platform), you will need to construct them in QML.
\sa TextEdit, Text
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index 204b135b8c..2b7f94d8bf 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -596,7 +596,6 @@ void QQuickTextNodeEngine::addGlyphsInRange(int rangeStart, int rangeLength,
for (int j=0; j<glyphRuns.size(); ++j) {
const QGlyphRun &glyphRun = glyphRuns.at(j);
addSelectedGlyphs(glyphRun);
- addUnselectedGlyphs(glyphRun);
}
}
@@ -762,11 +761,10 @@ void QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode *parentNode,
parentNode->addRectangleNode(rect, color);
}
- // Add all unselected text first
+ // Add all text with unselected color first
for (int i = 0; i < nodes.size(); ++i) {
const BinaryTreeNode *node = nodes.at(i);
- if (node->selectionState == Unselected)
- parentNode->addGlyphs(node->position, node->glyphRun, node->color, style, styleColor, 0);
+ parentNode->addGlyphs(node->position, node->glyphRun, node->color, style, styleColor, 0);
}
for (int i = 0; i < imageNodes.size(); ++i) {
@@ -823,14 +821,14 @@ void QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode *parentNode,
for (int i = 0; i < node->ranges.size(); ++i) {
const QPair<int, int> &range = node->ranges.at(i);
- int rangeLength = range.second - range.first + 1;
+ int rangeLength = range.second - range.first;
if (previousNode != 0) {
for (int j = 0; j < previousNode->ranges.size(); ++j) {
const QPair<int, int> &otherRange = previousNode->ranges.at(j);
- if (range.first <= otherRange.second && range.second >= otherRange.first) {
+ if (range.first < otherRange.second && range.second > otherRange.first) {
int start = qMax(range.first, otherRange.first);
int end = qMin(range.second, otherRange.second);
- rangeLength -= end - start + 1;
+ rangeLength -= end - start;
if (rangeLength == 0)
break;
}
@@ -841,10 +839,10 @@ void QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode *parentNode,
for (int j = 0; j < nextNode->ranges.size(); ++j) {
const QPair<int, int> &otherRange = nextNode->ranges.at(j);
- if (range.first <= otherRange.second && range.second >= otherRange.first) {
+ if (range.first < otherRange.second && range.second > otherRange.first) {
int start = qMax(range.first, otherRange.first);
int end = qMin(range.second, otherRange.second);
- rangeLength -= end - start + 1;
+ rangeLength -= end - start;
if (rangeLength == 0)
break;
}
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 501b1073a7..99dbf1d83e 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -112,7 +112,7 @@ public:
}
protected:
- void timerEvent(QTimerEvent *)
+ void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE
{
killTimer(m_timer);
m_timer = 0;
@@ -1110,7 +1110,6 @@ QQuickWindow::~QQuickWindow()
{
Q_D(QQuickWindow);
- d->animationController->deleteLater();
if (d->renderControl) {
QQuickRenderControlPrivate::get(d->renderControl)->windowDestroyed();
} else if (d->windowManager) {
@@ -3524,7 +3523,7 @@ QQmlIncubationController *QQuickWindow::incubationController() const
slot function needs to finish before execution continues, you must make sure that
the connection is direct (see Qt::ConnectionType).
- \warning Make very sure that a signal handler for afterRendering() leaves the GL
+ \warning Make very sure that a signal handler for sceneGraphAboutToStop() leaves the GL
context in the same state as it was when the signal handler was entered. Failing to
do so can result in the scene not rendering properly.