aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-06-21 15:08:43 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-29 11:51:03 +0200
commit101a5185138f4eb4d1ed0e69065d8e4c30a7fff7 (patch)
treef76f32cedfd5d509c86be149359d6b9525c64d3c /src
parenta1922317f8b2c219176553ff3f0db815f6f16cfd (diff)
Add Qt.application.organization/domain
Change-Id: Ic4a161b59d51e621e13c960f104d1a3be2ee64f8 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlengine.cpp10
-rw-r--r--src/qml/qml/qqmlglobal.cpp22
-rw-r--r--src/qml/qml/qqmlglobal_p.h8
3 files changed, 39 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 71fea41f78..a7fff20530 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -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().
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp
index 607ee4d0ac..78d2f5aa91 100644
--- a/src/qml/qml/qqmlglobal.cpp
+++ b/src/qml/qml/qqmlglobal.cpp
@@ -432,6 +432,16 @@ 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);
@@ -444,4 +454,16 @@ void QQmlApplication::setVersion(const QString &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);
+ emit organizationChanged(); //Note that we don't get notified if it's changed from C++
+}
+
+void QQmlApplication::setDomain(const QString &arg)
+{
+ QCoreApplication::instance()->setOrganizationDomain(arg);
+ emit domainChanged(); //Note that we don't get notified if it's changed from C++
+}
+
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index 114c076c60..d0f408d114 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);