aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-02-02 13:12:42 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-02-02 13:12:42 +0100
commit1d417a7bfa99695db7d8bf6b28a5141bf97e96cc (patch)
tree71d7fcd63cf14aa608284b436a481dca75014bc9 /src/quick
parenta1f0e69d162e9d6e1841b7a1e91dcca5e1109373 (diff)
parent666bc731a0ba930ca0cfda18daf836913fd91361 (diff)
Merge 5.6 into 5.6.0
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/doc/src/concepts/statesanimations/states.qdoc2
-rw-r--r--src/quick/items/qquickanimatedsprite_p.h4
-rw-r--r--src/quick/items/qquickdroparea.cpp2
-rw-r--r--src/quick/items/qquickpathview.cpp4
-rw-r--r--src/quick/items/qquicktext.cpp4
-rw-r--r--src/quick/items/qquicktext_p.h2
-rw-r--r--src/quick/items/qquicktextnode.cpp118
-rw-r--r--src/quick/items/qquickwindow.cpp17
-rw-r--r--src/quick/items/qquickwindow.h2
-rw-r--r--src/quick/items/qquickwindow_p.h1
10 files changed, 26 insertions, 130 deletions
diff --git a/src/quick/doc/src/concepts/statesanimations/states.qdoc b/src/quick/doc/src/concepts/statesanimations/states.qdoc
index b48a051379..981499ebc5 100644
--- a/src/quick/doc/src/concepts/statesanimations/states.qdoc
+++ b/src/quick/doc/src/concepts/statesanimations/states.qdoc
@@ -74,7 +74,7 @@ configurations with the \c PropertyChanges type.
\snippet qml/states.qml signal states
The \l PropertyChanges type will change the values of object properties.
Objects are referenced through their
-\l{qtqml-syntax-objectattributes.html#the-id-assignment}{id}. Objects outside
+\l{qtqml-syntax-objectattributes.html#the-id-attribute}{id}. Objects outside
the component are also referenced using the \c id property, exemplified by the
property change to the external \c flag object.
diff --git a/src/quick/items/qquickanimatedsprite_p.h b/src/quick/items/qquickanimatedsprite_p.h
index 87d489a60a..ffaddefb47 100644
--- a/src/quick/items/qquickanimatedsprite_p.h
+++ b/src/quick/items/qquickanimatedsprite_p.h
@@ -47,7 +47,7 @@
#include <QtQuick/QQuickItem>
#include <private/qquicksprite_p.h>
-#include <QTime>
+#include <QtCore/qelapsedtimer.h>
QT_BEGIN_NAMESPACE
@@ -366,7 +366,7 @@ private:
QQuickAnimatedSpriteMaterial *m_material;
QQuickSprite* m_sprite;
QQuickSpriteEngine* m_spriteEngine;
- QTime m_timestamp;
+ QElapsedTimer m_timestamp;
int m_curFrame;
bool m_pleaseReset;
bool m_running;
diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp
index e1b33b4660..b8006eedaf 100644
--- a/src/quick/items/qquickdroparea.cpp
+++ b/src/quick/items/qquickdroparea.cpp
@@ -264,6 +264,8 @@ void QQuickDropArea::dragEnterEvent(QDragEnterEvent *event)
QQuickDropEvent dragTargetEvent(d, event);
emit entered(&dragTargetEvent);
+ if (!event->isAccepted())
+ return;
d->containsDrag = true;
if (QQuickDragMimeData *dragMime = qobject_cast<QQuickDragMimeData *>(const_cast<QMimeData *>(mimeData)))
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index 05bf50574c..deb5582495 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -1978,6 +1978,7 @@ void QQuickPathView::refill()
break;
}
if (d->items.contains(item)) {
+ d->releaseItem(item);
break; //Otherwise we'd "re-add" it, and get confused
}
if (d->currentIndex == idx) {
@@ -2008,6 +2009,7 @@ void QQuickPathView::refill()
break;
}
if (d->items.contains(item)) {
+ d->releaseItem(item);
break; //Otherwise we'd "re-add" it, and get confused
}
if (d->currentIndex == idx) {
@@ -2049,6 +2051,8 @@ void QQuickPathView::refill()
int lastListIdx = d->items.indexOf(lastItem);
d->items.insert(lastListIdx + 1, item);
d->updateItem(item, nextPos);
+ } else {
+ d->releaseItem(item);
}
lastItem = item;
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 5c436d2074..3aec464958 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -224,7 +224,7 @@ void QQuickTextPrivate::setBottomPadding(qreal value, bool reset)
The default is true.
*/
-void QQuickText::q_imagesLoaded()
+void QQuickText::q_updateLayout()
{
Q_D(QQuickText);
d->updateLayout();
@@ -1170,7 +1170,7 @@ void QQuickTextPrivate::ensureDoc()
extra->doc->setDocumentMargin(0);
extra->doc->setBaseUrl(q->baseUrl());
qmlobject_connect(extra->doc, QQuickTextDocumentWithImageResources, SIGNAL(imagesLoaded()),
- q, QQuickText, SLOT(q_imagesLoaded()));
+ q, QQuickText, SLOT(q_updateLayout()));
}
}
diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h
index 5b385aeb0a..ea69aea3f9 100644
--- a/src/quick/items/qquicktext_p.h
+++ b/src/quick/items/qquicktext_p.h
@@ -292,7 +292,7 @@ protected:
void invalidateFontCaches();
private Q_SLOTS:
- void q_imagesLoaded();
+ void q_updateLayout();
void triggerPreprocess();
void imageDownloadFinished();
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp
index d40dedd798..2c7ab254f8 100644
--- a/src/quick/items/qquicktextnode.cpp
+++ b/src/quick/items/qquicktextnode.cpp
@@ -84,50 +84,6 @@ QQuickTextNode::~QQuickTextNode()
qDeleteAll(m_textures);
}
-#if 0
-void QQuickTextNode::setColor(const QColor &color)
-{
- if (m_usePixmapCache) {
- setUpdateFlag(UpdateNodes);
- } else {
- for (QSGNode *childNode = firstChild(); childNode; childNode = childNode->nextSibling()) {
- if (childNode->subType() == GlyphNodeSubType) {
- QSGGlyphNode *glyphNode = static_cast<QSGGlyphNode *>(childNode);
- if (glyphNode->color() == m_color)
- glyphNode->setColor(color);
- } else if (childNode->subType() == SolidRectNodeSubType) {
- QSGSimpleRectNode *solidRectNode = static_cast<QSGSimpleRectNode *>(childNode);
- if (solidRectNode->color() == m_color)
- solidRectNode->setColor(color);
- }
- }
- }
- m_color = color;
-}
-
-void QQuickTextNode::setStyleColor(const QColor &styleColor)
-{
- if (m_textStyle != QQuickTextNode::NormalTextStyle) {
- if (m_usePixmapCache) {
- setUpdateFlag(UpdateNodes);
- } else {
- for (QSGNode *childNode = firstChild(); childNode; childNode = childNode->nextSibling()) {
- if (childNode->subType() == GlyphNodeSubType) {
- QSGGlyphNode *glyphNode = static_cast<QSGGlyphNode *>(childNode);
- if (glyphNode->color() == m_styleColor)
- glyphNode->setColor(styleColor);
- } else if (childNode->subType() == SolidRectNodeSubType) {
- QSGSimpleRectNode *solidRectNode = static_cast<QSGSimpleRectNode *>(childNode);
- if (solidRectNode->color() == m_styleColor)
- solidRectNode->setColor(styleColor);
- }
- }
- }
- }
- m_styleColor = styleColor;
-}
-#endif
-
QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color,
QQuickText::TextStyle style, const QColor &styleColor,
QSGNode *parentNode)
@@ -312,78 +268,4 @@ void QQuickTextNode::deleteContent()
m_textures.clear();
}
-#if 0
-void QQuickTextNode::updateNodes()
-{
- return;
- deleteContent();
- if (m_text.isEmpty())
- return;
-
- if (m_usePixmapCache) {
- // ### gunnar: port properly
-// QPixmap pixmap = generatedPixmap();
-// if (pixmap.isNull())
-// return;
-
-// QSGImageNode *pixmapNode = m_context->createImageNode();
-// pixmapNode->setRect(pixmap.rect());
-// pixmapNode->setSourceRect(pixmap.rect());
-// pixmapNode->setOpacity(m_opacity);
-// pixmapNode->setClampToEdge(true);
-// pixmapNode->setLinearFiltering(m_linearFiltering);
-
-// appendChildNode(pixmapNode);
- } else {
- if (m_text.isEmpty())
- return;
-
- // Implement styling by drawing text several times at slight shifts. shiftForStyle
- // contains the sequence of shifted positions at which to draw the text. All except
- // the last will be drawn with styleColor.
- QList<QPointF> shiftForStyle;
- switch (m_textStyle) {
- case OutlineTextStyle:
- // ### Should be made faster by implementing outline material
- shiftForStyle << QPointF(-1, 0);
- shiftForStyle << QPointF(0, -1);
- shiftForStyle << QPointF(1, 0);
- shiftForStyle << QPointF(0, 1);
- break;
- case SunkenTextStyle:
- shiftForStyle << QPointF(0, -1);
- break;
- case RaisedTextStyle:
- shiftForStyle << QPointF(0, 1);
- break;
- default:
- break;
- }
-
- shiftForStyle << QPointF(0, 0); // Regular position
- while (!shiftForStyle.isEmpty()) {
- QPointF shift = shiftForStyle.takeFirst();
-
- // Use styleColor for all but last shift
- if (m_richText) {
- QColor overrideColor = shiftForStyle.isEmpty() ? QColor() : m_styleColor;
-
- QTextFrame *textFrame = m_textDocument->rootFrame();
- QPointF p = m_textDocument->documentLayout()->frameBoundingRect(textFrame).topLeft();
-
- QTextFrame::iterator it = textFrame->begin();
- while (!it.atEnd()) {
- addTextBlock(shift + p, it.currentBlock(), overrideColor);
- ++it;
- }
- } else {
- addTextLayout(shift, m_textLayout, shiftForStyle.isEmpty()
- ? m_color
- : m_styleColor);
- }
- }
- }
-}
-#endif
-
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 53527dcbd1..b93aa06336 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -285,6 +285,13 @@ void QQuickWindow::update()
QQuickRenderControlPrivate::get(d->renderControl)->update();
}
+void QQuickWindow::handleScreenChanged(QScreen *screen)
+{
+ Q_D(QQuickWindow);
+ Q_UNUSED(screen)
+ d->forcePolish();
+}
+
void forcePolishHelper(QQuickItem *item)
{
if (item->flags() & QQuickItem::ItemHasContents) {
@@ -299,12 +306,12 @@ void forcePolishHelper(QQuickItem *item)
/*!
Schedules polish events on all items in the scene.
*/
-void QQuickWindow::forcePolish()
+void QQuickWindowPrivate::forcePolish()
{
- Q_D(QQuickWindow);
- if (!screen())
+ Q_Q(QQuickWindow);
+ if (!q->screen())
return;
- forcePolishHelper(d->contentItem);
+ forcePolishHelper(contentItem);
}
void forceUpdate(QQuickItem *item)
@@ -473,7 +480,7 @@ void QQuickWindowPrivate::init(QQuickWindow *c, QQuickRenderControl *control)
QObject::connect(context, SIGNAL(invalidated()), q, SLOT(cleanupSceneGraph()), Qt::DirectConnection);
QObject::connect(q, SIGNAL(focusObjectChanged(QObject*)), q, SIGNAL(activeFocusItemChanged()));
- QObject::connect(q, SIGNAL(screenChanged(QScreen*)), q, SLOT(forcePolish()));
+ QObject::connect(q, SIGNAL(screenChanged(QScreen*)), q, SLOT(handleScreenChanged(QScreen*)));
QObject::connect(q, SIGNAL(frameSwapped()), q, SLOT(runJobsAfterSwap()), Qt::DirectConnection);
}
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index d5bf9fba81..9f8ad095cd 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -196,7 +196,7 @@ protected:
private Q_SLOTS:
void maybeUpdate();
void cleanupSceneGraph();
- void forcePolish();
+ void handleScreenChanged(QScreen *screen);
void setTransientParent_helper(QQuickWindow *window);
void runJobsAfterSwap();
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index e475c48b0a..623707140e 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -190,6 +190,7 @@ public:
void cleanup(QSGNode *);
void polishItems();
+ void forcePolish();
void syncSceneGraph();
void renderSceneGraph(const QSize &size);