aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-21 11:08:23 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-21 11:08:24 +0200
commit0aaca005c0bb6267ddd14a84634c33c813e2d2c4 (patch)
tree2c09a2498618830b32e92f13450fab2210aae446 /src
parent186cbe30939947e3a2d33b250fc861cbee361dfe (diff)
parent749a7212e903d8e8c6f256edb1836b9449cc7fe1 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp4
-rw-r--r--src/qml/qml/qqmlerror.cpp3
-rw-r--r--src/quick/items/qquickitem.cpp2
-rw-r--r--src/quick/items/qquicktext.cpp10
-rw-r--r--src/quick/items/qquicktextinput.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp2
-rw-r--r--src/quick/util/qquickanimatorjob.cpp14
-rw-r--r--src/quick/util/qquickfontloader.cpp4
-rw-r--r--src/quick/util/qquickglobal.cpp1
-rw-r--r--src/quick/util/qquickshortcut_p.h1
10 files changed, 29 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 2ac2b0b64d..1dd90995d3 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -992,6 +992,10 @@ void QObjectWrapper::destroyObject(bool lastCall)
// If the object is C++-owned, we still have to release the weak reference we have
// to it.
ddata->jsWrapper.clear();
+ if (lastCall && ddata->propertyCache) {
+ ddata->propertyCache->release();
+ ddata->propertyCache = nullptr;
+ }
}
}
}
diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp
index 7a1e02eec6..64f008cd32 100644
--- a/src/qml/qml/qqmlerror.cpp
+++ b/src/qml/qml/qqmlerror.cpp
@@ -44,6 +44,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qvector.h>
+#include <QtCore/qpointer.h>
#include <private/qv4errorobject_p.h>
@@ -86,7 +87,7 @@ public:
quint16 line;
quint16 column;
QtMsgType messageType;
- QObject *object;
+ QPointer<QObject> object;
};
QQmlErrorPrivate::QQmlErrorPrivate()
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 15042082fe..0bbf21607d 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -7179,6 +7179,8 @@ void QQuickItemPrivate::setHasCursorInChild(bool hasCursor)
QQuickItemPrivate *parentPrivate = QQuickItemPrivate::get(parent);
parentPrivate->setHasCursorInChild(hasCursor);
}
+#else
+ Q_UNUSED(hasCursor);
#endif
}
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 1720377046..c8bc76aef8 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -274,15 +274,9 @@ void QQuickTextPrivate::updateLayout()
elideLayout->clearFormats();
QString tmp = text;
multilengthEos = tmp.indexOf(QLatin1Char('\x9c'));
- if (multilengthEos != -1) {
+ if (multilengthEos != -1)
tmp = tmp.mid(0, multilengthEos);
- tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
- } else if (tmp.contains(QLatin1Char('\n'))) {
- // Replace always does a detach. Checking for the new line character first
- // means iterating over those items again if found but prevents a realloc
- // otherwise.
- tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
- }
+ tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
layout.setText(tmp);
}
textHasChanged = false;
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index a023ad8a8c..1edff3ff83 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -4403,7 +4403,9 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
}
bool unknown = false;
+#if QT_CONFIG(shortcut)
bool visual = cursorMoveStyle() == Qt::VisualMoveStyle;
+#endif
if (false) {
}
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 591b679ec4..bfe5642deb 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -295,6 +295,8 @@ static void qt_debug_remove_texture(QSGTexture* texture)
\value Anisotropy8x 8x anisotropic filtering.
\value Anisotropy16x 16x anisotropic filtering.
+
+ \since 5.9
*/
/*!
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index 89007cff1f..caf702bde5 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -140,6 +140,14 @@ QObject *QQuickAnimatorProxyJob::findAnimationContext(QQuickAbstractAnimation *a
void QQuickAnimatorProxyJob::updateCurrentTime(int)
{
+ if (m_internalState != State_Running)
+ return;
+
+ // A proxy which is being ticked should be associated with a window, (see
+ // setWindow() below). If we get here when there is no more controller we
+ // have a problem.
+ Q_ASSERT(m_controller);
+
// We do a simple check here to see if the animator has run and stopped on
// the render thread. isPendingStart() will perform a check against jobs
// that have been scheduled for start, but that will not yet have entered
@@ -150,8 +158,7 @@ void QQuickAnimatorProxyJob::updateCurrentTime(int)
// we might get the wrong value for this update, but then we'll simply
// pick it up on the next iterationm when the job is stopped and render
// thread is no longer using it.
- if (m_internalState == State_Running
- && !m_controller->isPendingStart(m_job)
+ if (!m_controller->isPendingStart(m_job)
&& !m_job->isRunning()) {
stop();
}
@@ -167,9 +174,9 @@ void QQuickAnimatorProxyJob::updateState(QAbstractAnimationJob::State newState,
}
} else if (newState == Stopped) {
- syncBackCurrentValues();
m_internalState = State_Stopped;
if (m_controller) {
+ syncBackCurrentValues();
m_controller->cancel(m_job);
}
}
@@ -193,6 +200,7 @@ void QQuickAnimatorProxyJob::setWindow(QQuickWindow *window)
if (m_job && m_controller)
m_controller->cancel(m_job);
m_controller = nullptr;
+ stop();
} else if (!m_controller && m_job) {
m_controller = QQuickWindowPrivate::get(window)->animationController;
diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp
index 3761a37a6d..21e8eda365 100644
--- a/src/quick/util/qquickfontloader.cpp
+++ b/src/quick/util/qquickfontloader.cpp
@@ -236,7 +236,7 @@ QQuickFontLoader::~QQuickFontLoader()
/*!
\qmlproperty url QtQuick::FontLoader::source
- The url of the font to load.
+ The URL of the font to load.
*/
QUrl QQuickFontLoader::source() const
{
@@ -317,7 +317,7 @@ void QQuickFontLoader::updateFontInfo(const QString& name, QQuickFontLoader::Sta
\qmlproperty string QtQuick::FontLoader::name
This property holds the name of the font family.
- It is set automatically when a font is loaded using the \c url property.
+ It is set automatically when a font is loaded using the \l source property.
Use this to set the \c font.family property of a \c Text item.
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 20bb23338d..2070fd7ff0 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -810,6 +810,7 @@ public:
#ifndef QT_NO_DESKTOPSERVICES
return QDesktopServices::openUrl(url);
#else
+ Q_UNUSED(url);
return false;
#endif
}
diff --git a/src/quick/util/qquickshortcut_p.h b/src/quick/util/qquickshortcut_p.h
index 93430ad893..db918058b2 100644
--- a/src/quick/util/qquickshortcut_p.h
+++ b/src/quick/util/qquickshortcut_p.h
@@ -111,6 +111,7 @@ protected:
bool event(QEvent *event) Q_DECL_OVERRIDE;
struct Shortcut {
+ Shortcut() : id(0) { }
bool matches(QShortcutEvent *event) const;
int id;
QVariant userValue;