aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
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
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')
-rw-r--r--src/quick/doc/qtquick.qdocconf3
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc2
-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
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp43
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h1
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.cpp10
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.cpp2
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp3
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp5
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp6
-rw-r--r--src/quick/scenegraph/util/qsgsimpletexturenode.cpp4
-rw-r--r--src/quick/util/qquickanimatorjob.cpp4
-rw-r--r--src/quick/util/qquickanimatorjob_p.h8
-rw-r--r--src/quick/util/qquickprofiler_p.h4
-rw-r--r--src/quick/util/qquickstyledtext.cpp6
35 files changed, 183 insertions, 91 deletions
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index afe1b9708f..7f43dc2c31 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -67,7 +67,8 @@ excludedirs += ../../imports/models \
examples.fileextensions += "*.qm"
-manifestmeta.thumbnail.names += "QtQuick/Threaded ListModel Example"
+manifestmeta.thumbnail.names += "QtQuick/Threaded ListModel Example" \
+ "QtQuick/QML Dynamic View Ordering Tutorial*"
navigation.landingpage = "Qt Quick"
navigation.cppclassespage = "Qt Quick C++ Classes"
diff --git a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc
index 4e894e5a33..e03b3a9bf8 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc
@@ -187,7 +187,7 @@ To visualize data, bind the view's \c model property to a model and the
QML provides several types of data models among the built-in set of QML
types. In addition, models can be created with Qt C++ and then made
- available to the \l{QQmlEngine}{QMLEngine} for use by
+ available to \l{QQmlEngine} for use by
QML components. For information about creating these models, visit the
\l{Using C++ Models with Qt Quick Views}
and \l{qtqml-typesystem-topic.html#qml-object-types}
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.
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 6d0ed4ce9f..8632ea0b52 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -1523,6 +1523,7 @@ void Renderer::prepareOpaqueBatches()
if (gni->clipList() == gnj->clipList()
&& gni->geometry()->drawingMode() == gnj->geometry()->drawingMode()
+ && (gni->geometry()->drawingMode() != GL_LINES || gni->geometry()->lineWidth() == gnj->geometry()->lineWidth())
&& gni->geometry()->attributes() == gnj->geometry()->attributes()
&& gni->inheritedOpacity() == gnj->inheritedOpacity()
&& gni->activeMaterial()->type() == gnj->activeMaterial()->type()
@@ -1621,6 +1622,7 @@ void Renderer::prepareAlphaBatches()
if (gni->clipList() == gnj->clipList()
&& gni->geometry()->drawingMode() == gnj->geometry()->drawingMode()
+ && (gni->geometry()->drawingMode() != GL_LINES || gni->geometry()->lineWidth() == gnj->geometry()->lineWidth())
&& gni->geometry()->attributes() == gnj->geometry()->attributes()
&& gni->inheritedOpacity() == gnj->inheritedOpacity()
&& gni->activeMaterial()->type() == gnj->activeMaterial()->type()
@@ -2283,6 +2285,7 @@ void Renderer::renderMergedBatch(const Batch *batch)
m_currentMaterial = material;
QSGGeometry* g = gn->geometry();
+ updateLineWidth(g);
char const *const *attrNames = program->attributeNames();
for (int i=0; i<batch->drawSets.size(); ++i) {
const DrawSet &draw = batch->drawSets.at(i);
@@ -2413,24 +2416,7 @@ void Renderer::renderUnmergedBatch(const Batch *batch)
offset += a.tupleSize * size_of_type(a.type);
}
- if (g->drawingMode() == GL_LINE_STRIP || g->drawingMode() == GL_LINE_LOOP || g->drawingMode() == GL_LINES)
- glLineWidth(g->lineWidth());
-#if !defined(QT_OPENGL_ES_2)
- else if (!QOpenGLContext::currentContext()->isOpenGLES() && g->drawingMode() == GL_POINTS) {
- QOpenGLFunctions_1_0 *gl1funcs = 0;
- QOpenGLFunctions_3_2_Core *gl3funcs = 0;
- if (QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CoreProfile)
- gl3funcs = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
- else
- gl1funcs = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_1_0>();
- Q_ASSERT(gl1funcs || gl3funcs);
- if (gl1funcs)
- gl1funcs->glPointSize(g->lineWidth());
- else
- gl3funcs->glPointSize(g->lineWidth());
- }
-#endif
-
+ updateLineWidth(g);
if (g->indexCount())
glDrawElements(g->drawingMode(), g->indexCount(), g->indexType(), iOffset);
else
@@ -2446,6 +2432,27 @@ void Renderer::renderUnmergedBatch(const Batch *batch)
}
}
+void Renderer::updateLineWidth(QSGGeometry *g)
+{
+ if (g->drawingMode() == GL_LINE_STRIP || g->drawingMode() == GL_LINE_LOOP || g->drawingMode() == GL_LINES)
+ glLineWidth(g->lineWidth());
+#if !defined(QT_OPENGL_ES_2)
+ else if (!QOpenGLContext::currentContext()->isOpenGLES() && g->drawingMode() == GL_POINTS) {
+ QOpenGLFunctions_1_0 *gl1funcs = 0;
+ QOpenGLFunctions_3_2_Core *gl3funcs = 0;
+ if (QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CoreProfile)
+ gl3funcs = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
+ else
+ gl1funcs = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_1_0>();
+ Q_ASSERT(gl1funcs || gl3funcs);
+ if (gl1funcs)
+ gl1funcs->glPointSize(g->lineWidth());
+ else
+ gl3funcs->glPointSize(g->lineWidth());
+ }
+#endif
+}
+
void Renderer::renderBatches()
{
if (Q_UNLIKELY(debug_render())) {
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
index c7b5f73688..d19fa0e17d 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
@@ -603,6 +603,7 @@ private:
void nodeWasRemoved(Node *node);
void nodeWasAdded(QSGNode *node, Node *shadowParent);
BatchRootInfo *batchRootInfo(Node *node);
+ void updateLineWidth(QSGGeometry *g);
inline Batch *newBatch();
void invalidateAndRecycleBatch(Batch *b);
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp
index 3f54e13c52..1fd37be84a 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.cpp
+++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp
@@ -522,7 +522,8 @@ void QSGGeometry::setDrawingMode(GLenum mode)
/*!
Gets the current line or point width or to be used for this geometry. This property
only applies to line width when the drawingMode is \c GL_LINES, \c GL_LINE_STRIP, or
- \c GL_LINE_LOOP, and only applies to point size when the drawingMode is \c GL_POINTS.
+ \c GL_LINE_LOOP. For desktop OpenGL, it also applies to point size when the drawingMode
+ is \c GL_POINTS.
The default value is \c 1.0
@@ -536,7 +537,12 @@ float QSGGeometry::lineWidth() const
/*!
Sets the line or point width to be used for this geometry to \a width. This property
only applies to line width when the drawingMode is \c GL_LINES, \c GL_LINE_STRIP, or
- \c GL_LINE_LOOP, and only applies to point size when the drawingMode is \c GL_POINTS.
+ \c GL_LINE_LOOP. For Desktop OpenGL, it also applies to point size when the drawingMode
+ is \c GL_POINTS.
+
+ \note How line width and point size are treated is implementation dependent: The application
+ should not rely on these, but rather create triangles or similar to draw areas. On OpenGL ES,
+ line width support is limited and point size is unsupported.
\sa lineWidth(), drawingMode()
*/
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp
index 71f4f62db9..51f3976ed9 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.cpp
+++ b/src/quick/scenegraph/coreapi/qsgnode.cpp
@@ -806,7 +806,7 @@ void QSGBasicGeometryNode::setGeometry(QSGGeometry *geometry)
the vertices and their structure, to be drawn. The Material defines how the shape is
filled.
- The following is a code snipped illustrating how to create a red
+ The following is a code snippet illustrating how to create a red
line using a QSGGeometryNode:
\code
QSGGeometry *geometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 2);
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 6c7fb89b6f..3059b750f2 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -34,6 +34,7 @@
#include "qsgrenderloop_p.h"
#include "qsgthreadedrenderloop_p.h"
#include "qsgwindowsrenderloop_p.h"
+#include <private/qquickanimatorcontroller_p.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QTime>
@@ -321,6 +322,8 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window)
} else if (gl && window == gl->surface() && current) {
gl->doneCurrent();
}
+
+ delete d->animationController;
}
void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 9a7407b421..4b78fefa99 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -477,11 +477,12 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor,
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- cleanup without an OpenGL context";
}
+ QQuickWindowPrivate *dd = QQuickWindowPrivate::get(window);
+
QQuickShaderEffectMaterial::cleanupMaterialCache();
// The canvas nodes must be cleaned up regardless if we are in the destructor..
if (wipeSG) {
- QQuickWindowPrivate *dd = QQuickWindowPrivate::get(window);
dd->cleanupNodesOnShutdown();
} else {
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- persistent SG, avoiding cleanup";
@@ -493,6 +494,8 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor,
sgrc->invalidate();
QCoreApplication::processEvents();
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ if (inDestructor)
+ delete dd->animationController;
if (current)
gl->doneCurrent();
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- invalidating scene graph";
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index c571e60018..7fd9651618 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -32,7 +32,6 @@
****************************************************************************/
#include "qsgwindowsrenderloop_p.h"
-
#include <QtCore/QCoreApplication>
#include <QtCore/QLibraryInfo>
#include <QtCore/QThread>
@@ -47,8 +46,8 @@
#include <QtQuick/QQuickWindow>
#include <private/qquickprofiler_p.h>
-
#include <private/qquickshadereffectnode_p.h>
+#include <private/qquickanimatorcontroller_p.h>
QT_BEGIN_NAMESPACE
@@ -219,6 +218,7 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window)
hide(window);
QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);
+
bool current = false;
QScopedPointer<QOffscreenSurface> offscreenSurface;
if (m_gl) {
@@ -245,6 +245,8 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window)
} else if (m_gl && current) {
m_gl->doneCurrent();
}
+
+ delete d->animationController;
}
bool QSGWindowsRenderLoop::anyoneShowing() const
diff --git a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp
index 8d38e83029..d9f3c44374 100644
--- a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp
+++ b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp
@@ -223,9 +223,11 @@ QRectF QSGSimpleTextureNode::sourceRect() const
void QSGSimpleTextureNode::setTexture(QSGTexture *texture)
{
Q_ASSERT(texture);
+ Q_D(QSGSimpleTextureNode);
+ if (d->ownsTexture)
+ delete m_material.texture();
m_material.setTexture(texture);
m_opaque_material.setTexture(texture);
- Q_D(QSGSimpleTextureNode);
qsgsimpletexturenode_update(&m_geometry, texture, m_rect, d->sourceRect, d->texCoordMode);
DirtyState dirty = DirtyMaterial;
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index 016f41d436..0182f8abfb 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -135,7 +135,7 @@ void QQuickAnimatorProxyJob::updateState(QAbstractAnimationJob::State newState,
void QQuickAnimatorProxyJob::debugAnimation(QDebug d) const
{
- d << "QuickAnimatorProxyJob("<< hex << (void *) this << dec
+ d << "QuickAnimatorProxyJob("<< hex << (const void *) this << dec
<< "state:" << state() << "duration:" << duration()
<< "proxying: (" << job() << ')';
}
@@ -224,7 +224,7 @@ QQuickAnimatorJob::QQuickAnimatorJob()
void QQuickAnimatorJob::debugAnimation(QDebug d) const
{
- d << "QuickAnimatorJob(" << hex << (void *) this << dec
+ d << "QuickAnimatorJob(" << hex << (const void *) this << dec
<< ") state:" << state() << "duration:" << duration()
<< "target:" << m_target << "value:" << m_value;
}
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 34c106e89b..ca70aecb8e 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -63,7 +63,7 @@ public:
QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObject *item);
~QQuickAnimatorProxyJob();
- int duration() const { return m_duration; }
+ int duration() const Q_DECL_OVERRIDE { return m_duration; }
QAbstractAnimationJob *job() const { return m_job; }
@@ -72,8 +72,8 @@ public:
void markJobManagedByController() { m_jobManagedByController = true; }
protected:
- void updateCurrentTime(int);
- void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState);
+ void updateCurrentTime(int) Q_DECL_OVERRIDE;
+ void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) Q_DECL_OVERRIDE;
void debugAnimation(QDebug d) const Q_DECL_OVERRIDE;
public Q_SLOTS:
@@ -116,7 +116,7 @@ public:
qreal to() const { return m_to; }
void setDuration(int duration) { m_duration = duration; }
- int duration() const { return m_duration; }
+ int duration() const Q_DECL_OVERRIDE { return m_duration; }
QEasingCurve easingCurve() const { return m_easing; }
void setEasingCurve(const QEasingCurve &curve) { m_easing = curve; }
diff --git a/src/quick/util/qquickprofiler_p.h b/src/quick/util/qquickprofiler_p.h
index 2eec9bf877..6b6e7fa062 100644
--- a/src/quick/util/qquickprofiler_p.h
+++ b/src/quick/util/qquickprofiler_p.h
@@ -259,7 +259,7 @@ public:
}
template<SceneGraphFrameType FrameType, bool Record>
- static void reportSceneGraphFrame(quint64 payload = -1)
+ static void reportSceneGraphFrame(quint64 payload = ~0)
{
qint64 *timings = s_instance->m_sceneGraphData.timings<FrameType>();
int &offset = s_instance->m_sceneGraphData.offset<FrameType>();
@@ -275,7 +275,7 @@ public:
}
template<SceneGraphFrameType FrameType, bool Record, SceneGraphFrameType SwitchTo>
- static void reportSceneGraphFrame(quint64 payload = -1)
+ static void reportSceneGraphFrame(quint64 payload = ~0)
{
reportSceneGraphFrame<FrameType, Record>(payload);
s_instance->m_sceneGraphData.offset<SwitchTo>() = 0;
diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp
index 6b1768e9ef..c411207121 100644
--- a/src/quick/util/qquickstyledtext.cpp
+++ b/src/quick/util/qquickstyledtext.cpp
@@ -542,6 +542,12 @@ void QQuickStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textI
textOut += QChar(38);
else if (entity == QLatin1String("quot"))
textOut += QChar(34);
+ else if (entity == QLatin1String("nbsp"))
+ textOut += QChar(QChar::Nbsp);
+ return;
+ } else if (*ch == QLatin1Char(' ')) {
+ QStringRef entity(&textIn, entityStart - 1, entityLength + 1);
+ textOut += entity + *ch;
return;
}
++entityLength;