aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-07-22 13:43:43 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-07-22 13:43:43 +0200
commit3a6f5735ee723ff998114314c5ccdf6609667f6f (patch)
tree9c877dd1e35972fa336cea8a61986594f168b49c /src/qml
parent000b6330d4ca7165ff241b21ee728ed28d82fba1 (diff)
parent17ded06804576dfde1b19f82f168f7ceb09ec92c (diff)
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts: src/quick/items/context2d/qquickcontext2d.cpp tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro Change-Id: I36a4fd28b3156839aecd70039a3ba566bf19a0bc
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/debugger/qqmldebug.h6
-rw-r--r--src/qml/doc/qtqml.qdocconf4
-rw-r--r--src/qml/doc/src/whatsnew.qdoc7
-rw-r--r--src/qml/qml/ftw/qqmltrace.cpp1
-rw-r--r--src/qml/qml/qqml.h3
-rw-r--r--src/qml/qml/qqmlcomponent.cpp6
-rw-r--r--src/qml/qml/qqmlengine.cpp17
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp9
-rw-r--r--src/qml/qml/qqmlextensionplugin.h1
-rw-r--r--src/qml/qml/qqmlglobal.cpp38
-rw-r--r--src/qml/qml/qqmlglobal_p.h8
-rw-r--r--src/qml/qml/qqmlplatform.cpp2
-rw-r--r--src/qml/types/qqmllistmodel.cpp18
13 files changed, 92 insertions, 28 deletions
diff --git a/src/qml/debugger/qqmldebug.h b/src/qml/debugger/qqmldebug.h
index d2b0220bc6..d6b6bb0301 100644
--- a/src/qml/debugger/qqmldebug.h
+++ b/src/qml/debugger/qqmldebug.h
@@ -54,9 +54,9 @@ struct Q_QML_EXPORT QQmlDebuggingEnabler
// Execute code in constructor before first QQmlEngine is instantiated
#if defined(QT_QML_DEBUG_NO_WARNING)
-static QQmlDebuggingEnabler qmlEnableDebuggingHelper(false);
-#elif defined(QT_QML_DEBUG) || defined(QT_DECLARATIVE_DEBUG)
-static QQmlDebuggingEnabler qmlEnableDebuggingHelper(true);
+static QQmlDebuggingEnabler qQmlEnableDebuggingHelper(false);
+#elif defined(QT_QML_DEBUG)
+static QQmlDebuggingEnabler qQmlEnableDebuggingHelper(true);
#endif
QT_END_NAMESPACE
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 2198428a38..da596a1d97 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -47,3 +47,7 @@ exampledirs += ../../../examples/qml \
snippets
imagedirs += images
+
+navigation.landingpage = "Qt QML"
+navigation.cppclassespage = "Qt QML C++ Classes"
+navigation.qmltypespage = "Qt QML QML Types"
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc
index eece3bcaab..9ad8c23a42 100644
--- a/src/qml/doc/src/whatsnew.qdoc
+++ b/src/qml/doc/src/whatsnew.qdoc
@@ -37,6 +37,11 @@ a summary of the new changes:
\li New QQmlApplicationEngine convenience class for QML applications.
\li New Instantiatior type for generic, dynamic object creation.
\li New properties for \l Qt.application: arguments, name, and version.
+\li The 'with' statement has been deprecated and is slated for removal in a
+ future version of the language.
+\li New \l Qt.platform object with an os property
+\li New \l qmlClearTypeRegistations() function drops all data from qmlRegisterType calls
+\li New \l qmlRegisterType function for registering composite types.
\endlist
\section2 New Submodule
@@ -110,6 +115,8 @@ has now been replaced by the new \l {Qt QML} and \l {Qt Quick} modules. See the
\list
\li Arbitrary functionality may be provided in a namespace through a singleton type. See qmlRegisterSingletonType() for more information.
\li JavaScript (.js) files may now import QML modules and other JavaScript files using the ".import" syntax.
+\li Plugins may now use QQmlExtensionPlugin::baseUrl to get the directory from which the plugin is loaded.
+ This will be useful if the plugin needs to load QML or other assets from the same directory.
\endlist
\section2 Other
diff --git a/src/qml/qml/ftw/qqmltrace.cpp b/src/qml/qml/ftw/qqmltrace.cpp
index 98f86dad32..9bf58c245c 100644
--- a/src/qml/qml/ftw/qqmltrace.cpp
+++ b/src/qml/qml/ftw/qqmltrace.cpp
@@ -43,6 +43,7 @@
#ifdef QML_ENABLE_TRACE
#include <stdio.h>
+#include <unistd.h>
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h
index fb0133f305..b48a776b4f 100644
--- a/src/qml/qml/qqml.h
+++ b/src/qml/qml/qqml.h
@@ -49,7 +49,6 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qmetaobject.h>
-#include <QtCore/qdebug.h>
#define QML_VERSION 0x020000
#define QML_VERSION_STR "2.0"
@@ -477,7 +476,7 @@ inline int qmlRegisterType(const QUrl &url, const char *uri, int versionMajor, i
{
if (url.isRelative()) {
// User input check must go here, because QQmlPrivate::qmlregister is also used internally for composite types
- qWarning() << "qmlRegisterType requires absolute URLs.";
+ qWarning("qmlRegisterType requires absolute URLs.");
return 0;
}
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index cd5d1e96b7..e59116a7c1 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -785,8 +785,7 @@ QQmlComponent::QQmlComponent(QQmlComponentPrivate &dd, QObject *parent)
If \a context is 0 (the default), it will create the instance in the
engine' s \l {QQmlEngine::rootContext()}{root context}.
- The ownership of the returned object instance is determined by the QQmlEngine.
- By default the caller has to take care that the object is eventually deleted.
+ The ownership of the returned object instance is transferred to the caller.
\sa QQmlEngine::ObjectOwnership
*/
@@ -827,8 +826,7 @@ QObject *QQmlComponent::create(QQmlContext *context)
communicate information to an instantiated component, as it allows their
initial values to be configured before property bindings take effect.
- The ownership of the returned object instance is determined by the QQmlEngine.
- By default the caller has to take care that the object is eventually deleted.
+ The ownership of the returned object instance is transferred to the caller.
\sa completeCreate(), QQmlEngine::ObjectOwnership
*/
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 2b186dbb75..dbf098e701 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -391,9 +391,9 @@ The following functions are also on the Qt object.
\list
\li \c "android" - Android
\li \c "blackberry" - BlackBerry OS
- \li \c "ios" - Apple iOS
+ \li \c "ios" - iOS
\li \c "linux" - Linux
- \li \c "mac" - Mac OS X
+ \li \c "osx" - OS X
\li \c "unix" - Other Unix-based OS
\li \c "windows" - Windows
\li \c "wince" - Windows CE
@@ -451,7 +451,15 @@ The following functions are also on the Qt object.
\row
\li \c application.version
\li This is the application version set on the QCoreApplication instance. This property can be written
- to in order to set the application name.
+ to in order to set the application version.
+ \row
+ \li \c application.organization
+ \li This is the organization name set on the QCoreApplication instance. This property can be written
+ to in order to set the organization name.
+ \row
+ \li \c application.domain
+ \li This is the organization domain set on the QCoreApplication instance. This property can be written
+ to in order to set the organization domain.
\endtable
The object also has one signal, aboutToQuit(), which is the same as \l QCoreApplication::aboutToQuit().
@@ -855,9 +863,6 @@ QQmlEngine::~QQmlEngine()
QList<QQmlType*> singletonTypes = QQmlMetaType::qmlSingletonTypes();
foreach (QQmlType *currType, singletonTypes)
currType->singletonInstanceInfo()->destroy(this);
-
- if (d->incubationController)
- d->incubationController->d = 0;
}
/*! \fn void QQmlEngine::quit()
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index f77b176404..30eca7b112 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
/*!
- \since 5.0
+ \since Qt 5.0
\inmodule QtQml
\class QQmlExtensionPlugin
\brief The QQmlExtensionPlugin class provides an abstract base for custom QML extension plugins.
@@ -156,6 +156,13 @@ QQmlExtensionPlugin::~QQmlExtensionPlugin()
{
}
+/*!
+ \since Qt 5.1
+ \brief Returns the URL of the directory from which the extension is loaded.
+
+ This is useful when the plugin also needs to load QML files or other
+ assets from the same directory.
+*/
QUrl QQmlExtensionPlugin::baseUrl() const
{
Q_D(const QQmlExtensionPlugin);
diff --git a/src/qml/qml/qqmlextensionplugin.h b/src/qml/qml/qqmlextensionplugin.h
index 170c7915a5..245651979b 100644
--- a/src/qml/qml/qqmlextensionplugin.h
+++ b/src/qml/qml/qqmlextensionplugin.h
@@ -68,6 +68,7 @@ public:
virtual void registerTypes(const char *uri) = 0;
virtual void initializeEngine(QQmlEngine *engine, const char *uri);
+private:
Q_DISABLE_COPY(QQmlExtensionPlugin)
};
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp
index 8418217ab9..939b7e465a 100644
--- a/src/qml/qml/qqmlglobal.cpp
+++ b/src/qml/qml/qqmlglobal.cpp
@@ -403,6 +403,14 @@ QQmlApplication::QQmlApplication(QObject *parent)
{
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),
this, SIGNAL(aboutToQuit()));
+ connect(QCoreApplication::instance(), SIGNAL(applicationNameChanged()),
+ this, SIGNAL(nameChanged()));
+ connect(QCoreApplication::instance(), SIGNAL(applicationVersionChanged()),
+ this, SIGNAL(versionChanged()));
+ connect(QCoreApplication::instance(), SIGNAL(organizationNameChanged()),
+ this, SIGNAL(organizationChanged()));
+ connect(QCoreApplication::instance(), SIGNAL(organizationDomainChanged()),
+ this, SIGNAL(domainChanged()));
}
QQmlApplication::QQmlApplication(QQmlApplicationPrivate &dd, QObject *parent)
@@ -410,6 +418,14 @@ QQmlApplication::QQmlApplication(QQmlApplicationPrivate &dd, QObject *parent)
{
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),
this, SIGNAL(aboutToQuit()));
+ connect(QCoreApplication::instance(), SIGNAL(applicationNameChanged()),
+ this, SIGNAL(nameChanged()));
+ connect(QCoreApplication::instance(), SIGNAL(applicationVersionChanged()),
+ this, SIGNAL(versionChanged()));
+ connect(QCoreApplication::instance(), SIGNAL(organizationNameChanged()),
+ this, SIGNAL(organizationChanged()));
+ connect(QCoreApplication::instance(), SIGNAL(organizationDomainChanged()),
+ this, SIGNAL(domainChanged()));
}
QStringList QQmlApplication::args()
@@ -432,16 +448,34 @@ QString QQmlApplication::version() const
return QCoreApplication::instance()->applicationVersion();
}
+QString QQmlApplication::organization() const
+{
+ return QCoreApplication::instance()->organizationName();
+}
+
+QString QQmlApplication::domain() const
+{
+ return QCoreApplication::instance()->organizationDomain();
+}
+
void QQmlApplication::setName(const QString &arg)
{
QCoreApplication::instance()->setApplicationName(arg);
- emit nameChanged(); //Note that we don't get notified if it's changed from C++
}
void QQmlApplication::setVersion(const QString &arg)
{
QCoreApplication::instance()->setApplicationVersion(arg);
- emit versionChanged(); //Note that we don't get notified if it's changed from C++
+}
+
+void QQmlApplication::setOrganization(const QString &arg)
+{
+ QCoreApplication::instance()->setOrganizationName(arg);
+}
+
+void QQmlApplication::setDomain(const QString &arg)
+{
+ QCoreApplication::instance()->setOrganizationDomain(arg);
}
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index 0c9e685a07..7b968a7e46 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -322,6 +322,8 @@ class Q_QML_PRIVATE_EXPORT QQmlApplication : public QObject
Q_PROPERTY(QStringList arguments READ args CONSTANT)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString version READ version WRITE setVersion NOTIFY versionChanged)
+ Q_PROPERTY(QString organization READ organization WRITE setOrganization NOTIFY organizationChanged)
+ Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged)
public:
QQmlApplication(QObject* parent=0);
@@ -329,16 +331,22 @@ public:
QString name() const;
QString version() const;
+ QString organization() const;
+ QString domain() const;
public Q_SLOTS:
void setName(const QString &arg);
void setVersion(const QString &arg);
+ void setOrganization(const QString &arg);
+ void setDomain(const QString &arg);
Q_SIGNALS:
void aboutToQuit();
void nameChanged();
void versionChanged();
+ void organizationChanged();
+ void domainChanged();
protected:
QQmlApplication(QQmlApplicationPrivate &dd, QObject* parent=0);
diff --git a/src/qml/qml/qqmlplatform.cpp b/src/qml/qml/qqmlplatform.cpp
index de48f60f56..04862379be 100644
--- a/src/qml/qml/qqmlplatform.cpp
+++ b/src/qml/qml/qqmlplatform.cpp
@@ -66,7 +66,7 @@ QString QQmlPlatform::os()
#elif defined(Q_OS_IOS)
return QLatin1String("ios");
#elif defined(Q_OS_MAC)
- return QLatin1String("mac");
+ return QLatin1String("osx");
#elif defined(Q_OS_WINCE)
return QLatin1String("wince");
#elif defined(Q_OS_WIN)
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 4c0b382439..067d91ea7f 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1838,7 +1838,7 @@ int QQmlListModel::count() const
}
/*!
- \qmlmethod QtQml2::ListModel::clear()
+ \qmlmethod ListModel::clear()
Deletes all content from the model.
@@ -1860,7 +1860,7 @@ void QQmlListModel::clear()
}
/*!
- \qmlmethod QtQml2::ListModel::remove(int index, int count = 1)
+ \qmlmethod ListModel::remove(int index, int count = 1)
Deletes the content at \a index from the model.
@@ -1894,7 +1894,7 @@ void QQmlListModel::remove(QQmlV4Function *args)
}
/*!
- \qmlmethod QtQml2::ListModel::insert(int index, jsobject dict)
+ \qmlmethod ListModel::insert(int index, jsobject dict)
Adds a new item to the list model at position \a index, with the
values in \a dict.
@@ -1952,7 +1952,7 @@ void QQmlListModel::insert(QQmlV4Function *args)
}
/*!
- \qmlmethod QtQml2::ListModel::move(int from, int to, int n)
+ \qmlmethod ListModel::move(int from, int to, int n)
Moves \a n items \a from one position \a to another.
@@ -2005,7 +2005,7 @@ void QQmlListModel::move(int from, int to, int n)
}
/*!
- \qmlmethod QtQml2::ListModel::append(jsobject dict)
+ \qmlmethod ListModel::append(jsobject dict)
Adds a new item to the end of the list model, with the
values in \a dict.
@@ -2056,7 +2056,7 @@ void QQmlListModel::append(QQmlV4Function *args)
}
/*!
- \qmlmethod object QtQml2::ListModel::get(int index)
+ \qmlmethod object ListModel::get(int index)
Returns the item at \a index in the list model. This allows the item
data to be accessed or modified from JavaScript:
@@ -2106,7 +2106,7 @@ QQmlV4Handle QQmlListModel::get(int index) const
}
/*!
- \qmlmethod QtQml2::ListModel::set(int index, jsobject dict)
+ \qmlmethod ListModel::set(int index, jsobject dict)
Changes the item at \a index in the list model with the
values in \a dict. Properties not appearing in \a dict
@@ -2160,7 +2160,7 @@ void QQmlListModel::set(int index, const QQmlV4Handle &handle)
}
/*!
- \qmlmethod QtQml2::ListModel::setProperty(int index, string property, variant value)
+ \qmlmethod ListModel::setProperty(int index, string property, variant value)
Changes the \a property of the item at \a index in the list model to \a value.
@@ -2203,7 +2203,7 @@ void QQmlListModel::setProperty(int index, const QString& property, const QVaria
}
/*!
- \qmlmethod QtQml2::ListModel::sync()
+ \qmlmethod ListModel::sync()
Writes any unsaved changes to the list model after it has been modified
from a worker script.