diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-02-07 17:06:03 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-02-07 17:07:44 +0100 |
commit | b907a01b467b551756b108f6c9a04d7e7382ae64 (patch) | |
tree | 2d21d785186ce485f615034e6667d9673b62a4fc /src/qml | |
parent | 4f8537ff8c9427705e3587861a62fe81cf3e503b (diff) | |
parent | 1d29d8edf8e4e709ca2f27791cdf8672c15488f3 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
examples/quick/textureprovider/etcprovider.h
src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp
src/qml/doc/qtqml.qdocconf
src/quick/doc/qtquick.qdocconf
tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
Change-Id: I5027b0ee024e00b9525bd45516b7f401ff7d4ae4
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/doc/qtqml.qdocconf | 12 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlextensionplugin.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 23 | ||||
-rw-r--r-- | src/qml/qml/qqmlrewrite.cpp | 16 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsengine.cpp | 1 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8engine.cpp | 6 |
8 files changed, 39 insertions, 29 deletions
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf index 45fecc1896..ecd6b81823 100644 --- a/src/qml/doc/qtqml.qdocconf +++ b/src/qml/doc/qtqml.qdocconf @@ -2,20 +2,20 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtQml description = Qt QML Reference Documentation -url = http://qt-project.org/doc/qt-5.0/qtqml -version = 5.1.0 +url = http://qt-project.org/doc/qt-$QT_VER/qtqml +version = $QT_VERSION qhp.projects = QtQml qhp.QtQml.file = qtqml.qhp -qhp.QtQml.namespace = org.qt-project.qtqml.510 +qhp.QtQml.namespace = org.qt-project.qtqml.$QT_VERSION_TAG qhp.QtQml.virtualFolder = qtqml qhp.QtQml.indexTitle = Qt QML qhp.QtQml.indexRoot = -qhp.QtQml.filterAttributes = qtqml 5.1.0 qtrefdoc -qhp.QtQml.customFilters.Qt.name = QtQml 5.1.0 -qhp.QtQml.customFilters.Qt.filterAttributes = qtqml 5.1.0 +qhp.QtQml.filterAttributes = qtqml $QT_VERSION qtrefdoc +qhp.QtQml.customFilters.Qt.name = QtQml $QT_VERSION +qhp.QtQml.customFilters.Qt.filterAttributes = qtqml $QT_VERSION qhp.QtQml.subprojects = classes examples qhp.QtQml.subprojects.classes.title = C++ Classes qhp.QtQml.subprojects.classes.indexTitle = Qt QML Module C++ Classes diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 1928bcb4b5..b335d6f402 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -664,7 +664,7 @@ void QQmlComponentPrivate::loadUrl(const QUrl &newUrl, QQmlComponent::Compilatio if (newUrl.isEmpty()) { QQmlError error; - error.setDescription(q->tr("Invalid empty URL")); + error.setDescription(QQmlComponent::tr("Invalid empty URL")); state.errors << error; return; } diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp index f824da2bbd..bbc0fed768 100644 --- a/src/qml/qml/qqmlextensionplugin.cpp +++ b/src/qml/qml/qqmlextensionplugin.cpp @@ -58,8 +58,8 @@ QT_BEGIN_NAMESPACE To write a QML extension plugin: \list - \li Subclass QQmlExtensionPlugin, implement registerTypes() method - to register types using qmlRegisterType(), and export the class using the Q_EXPORT_PLUGIN2() macro + \li Subclass QQmlExtensionPlugin, implement registerTypes() method to register types + using qmlRegisterType(), and export the class using the Q_PLUGIN_METADATA() macro \li Write an appropriate project file for the plugin \li Create a \l{Module Definition qmldir Files}{qmldir file} to describe the plugin \endlist @@ -140,7 +140,7 @@ QT_BEGIN_NAMESPACE Constructs a QML extension plugin with the given \a parent. Note that this constructor is invoked automatically by the - Q_EXPORT_PLUGIN2() macro, so there is no need for calling it + Q_PLUGIN_METADATA() macro, so there is no need for calling it explicitly. */ QQmlExtensionPlugin::QQmlExtensionPlugin(QObject *parent) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index f2573895c6..52d07b23ec 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -208,10 +208,6 @@ public: QQmlTypeLoader *typeLoader; - static inline QString tr(const char *str) { - return QQmlImportDatabase::tr(str); - } - static bool locateQmldir(const QString &uri, int vmaj, int vmin, QQmlImportDatabase *database, QString *outQmldirFilePath, QString *outUrl); @@ -735,7 +731,7 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath, // The reason is that the lower level may add url and line/column numbering information. QQmlError poppedError = errors->takeFirst(); QQmlError error; - error.setDescription(tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(poppedError.description())); + error.setDescription(QQmlImportDatabase::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(poppedError.description())); error.setUrl(QUrl::fromLocalFile(qmldirFilePath)); errors->prepend(error); } @@ -744,7 +740,7 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath, } else { if (errors) { QQmlError error; - error.setDescription(tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name)); + error.setDescription(QQmlImportDatabase::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name)); error.setUrl(QUrl::fromLocalFile(qmldirFilePath)); errors->prepend(error); } @@ -1035,9 +1031,9 @@ bool QQmlImportsPrivate::addLibraryImport(const QString& uri, const QString &pre if (inserted->qmlDirComponents.isEmpty() && inserted->qmlDirScripts.isEmpty()) { QQmlError error; if (QQmlMetaType::isAnyModule(uri)) - error.setDescription(tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin)); + error.setDescription(QQmlImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin)); else - error.setDescription(tr("module \"%1\" is not installed").arg(uri)); + error.setDescription(QQmlImportDatabase::tr("module \"%1\" is not installed").arg(uri)); errors->prepend(error); return false; } else if ((vmaj >= 0) && (vmin >= 0) && qmldir) { @@ -1082,7 +1078,7 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix if (!QQmlFile::bundleDirectoryExists(dir, typeLoader->engine())) { if (!isImplicitImport) { QQmlError error; - error.setDescription(tr("\"%1\": no such directory").arg(uri)); + error.setDescription(QQmlImportDatabase::tr("\"%1\": no such directory").arg(uri)); error.setUrl(QUrl(qmldirUrl)); errors->prepend(error); } @@ -1107,7 +1103,7 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix if (!typeLoader->directoryExists(dir)) { if (!isImplicitImport) { QQmlError error; - error.setDescription(tr("\"%1\": no such directory").arg(uri)); + error.setDescription(QQmlImportDatabase::tr("\"%1\": no such directory").arg(uri)); error.setUrl(QUrl(qmldirUrl)); errors->prepend(error); } @@ -1127,7 +1123,7 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix if (!isImplicitImport) { QQmlError error; - error.setDescription(tr("import \"%1\" has no qmldir and no namespace").arg(importUri)); + error.setDescription(QQmlImportDatabase::tr("import \"%1\" has no qmldir and no namespace").arg(importUri)); error.setUrl(QUrl(qmldirUrl)); errors->prepend(error); } @@ -1187,9 +1183,9 @@ bool QQmlImportsPrivate::updateQmldirContent(const QString &uri, const QString & if (uri != QLatin1String(".")) { QQmlError error; if (QQmlMetaType::isAnyModule(uri)) - error.setDescription(tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin)); + error.setDescription(QQmlImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin)); else - error.setDescription(tr("module \"%1\" is not installed").arg(uri)); + error.setDescription(QQmlImportDatabase::tr("module \"%1\" is not installed").arg(uri)); errors->prepend(error); return false; } @@ -1344,6 +1340,7 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) QQmlImportDatabase::~QQmlImportDatabase() { + qDeleteAll(qmldirCache); qmldirCache.clear(); } diff --git a/src/qml/qml/qqmlrewrite.cpp b/src/qml/qml/qqmlrewrite.cpp index 0913a8c224..0e281428ed 100644 --- a/src/qml/qml/qqmlrewrite.cpp +++ b/src/qml/qml/qqmlrewrite.cpp @@ -44,6 +44,7 @@ #include <private/qqmlglobal_p.h> #include <QtCore/qdebug.h> +#include <QtCore/qcoreapplication.h> QT_BEGIN_NAMESPACE @@ -513,8 +514,15 @@ bool RewriteSignalHandler::visit(AST::IdentifierExpression *e) return false; } -static QString unnamed_error_string(QLatin1String(QT_TR_NOOP("Signal uses unnamed parameter followed by named parameter."))); -static QString global_error_string(QLatin1String(QT_TR_NOOP("Signal parameter \"%1\" hides global variable."))); +static inline QString msgUnnamedErrorString() +{ + return QCoreApplication::translate("QQmlRewrite", "Signal uses unnamed parameter followed by named parameter."); +} + +static inline QString msgGlobalErrorString(const QString &p) +{ + return QCoreApplication::translate("QQmlRewrite", "Signal parameter \"%1\" hides global variable.").arg(p); +} #define EXIT_ON_ERROR(error) \ { \ @@ -543,9 +551,9 @@ QString RewriteSignalHandler::createParameterString(const QList<QHashedString> & if (param.isEmpty()) unnamedParam = true; else if (unnamedParam) - EXIT_ON_ERROR(unnamed_error_string) + EXIT_ON_ERROR(msgUnnamedErrorString()) else if (illegalNames.contains(param)) - EXIT_ON_ERROR(global_error_string.arg(param)) + EXIT_ON_ERROR(msgGlobalErrorString(param)) ++_parameterCountForJS; parameters += param; if (i < parameterNameList.count()-1) diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index dc63db1dea..aa7a2d95c7 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -2289,7 +2289,7 @@ void QQmlScriptBlob::done() error.setUrl(finalUrl()); error.setLine(script.location.line); error.setColumn(script.location.column); - error.setDescription(typeLoader()->tr("Script %1 unavailable").arg(script.script->url().toString())); + error.setDescription(QQmlTypeLoader::tr("Script %1 unavailable").arg(script.script->url().toString())); errors.prepend(error); setError(errors); } diff --git a/src/qml/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp index acc734d549..5b1464afe6 100644 --- a/src/qml/qml/v8/qjsengine.cpp +++ b/src/qml/qml/v8/qjsengine.cpp @@ -349,7 +349,6 @@ QJSValue QJSEngine::create(int type, const void *ptr) /*! \internal - \since 4.5 convert \a value to \a type, store the result in \a ptr */ bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr) diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 3fe3d28b67..2619c1a484 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -813,6 +813,12 @@ QDateTime QV8Engine::qtDateTimeFromJsDate(double jsDate) v8::Persistent<v8::Object> *QV8Engine::findOwnerAndStrength(QObject *object, bool *shouldBeStrong) { + QQmlData *data = QQmlData::get(object); + if (data && data->rootObjectInCreation) { // When the object is still being created it may not show up to the GC. + *shouldBeStrong = true; + return 0; + } + QObject *parent = object->parent(); if (!parent) { // if the object has JS ownership, the object's v8object owns the lifetime of the persistent value. |