aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/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/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/qml')
-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
9 files changed, 69 insertions, 16 deletions
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)