aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-20 08:21:42 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-09-20 08:29:17 +0200
commitbbb78a92a910d32b2886af62c218db87325eb6ce (patch)
tree0e4b55352bb9f083826d0e80747982823f2894ed /src/qml/qml/qqmlengine.cpp
parent4b5a7b15fc6d3650c8e9b7bf619804a0a953eeba (diff)
parent8ed38c70fd29680f7981d9d23581d46cf32139d0 (diff)
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into HEAD
Conflicts: src/qml/compiler/qv4isel_masm.cpp src/qml/jsruntime/qv4script.cpp src/qml/qml/qml.pri src/qml/qml/qqmltypeloader_p.h Change-Id: Ia784d855a2131e3289454f12d841ca2c65be15c1
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r--src/qml/qml/qqmlengine.cpp62
1 files changed, 50 insertions, 12 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 971836f783..a2c190d0e6 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -63,10 +63,10 @@
#include "qqmltypenamecache_p.h"
#include "qqmlnotifier_p.h"
#include <private/qqmlprofilerservice_p.h>
-#include <private/qv8debugservice_p.h>
+#include <private/qv4debugservice_p.h>
#include <private/qdebugmessageservice_p.h>
#include "qqmlincubator.h"
-#include "qqmlabstracturlinterceptor_p.h"
+#include "qqmlabstracturlinterceptor.h"
#include <private/qv8profilerservice_p.h>
#include <private/qqmlboundsignal_p.h>
@@ -411,14 +411,50 @@ The following functions are also on the Qt object.
\row
\li \c application.active
\li
- This read-only property indicates whether the application is the top-most and focused
- application, and the user is able to interact with the application. The property
- is false when the application is in the background, the device keylock or screen
- saver is active, the screen backlight is turned off, or the global system dialog
- is being displayed on top of the application. It can be used for stopping and
- pausing animations, timers and active processing of data in order to save device
- battery power and free device memory and processor load when the application is not
- active.
+ Deprecated, use Qt.application.state == Qt.ApplicationActive instead.
+
+ \row
+ \li \c application.state
+ \li
+ This read-only property indicates the current state of the application.
+
+ Possible values are:
+
+ \list
+ \li Qt.ApplicationActive - The application is the top-most and focused application, and the
+ user is able to interact with the application.
+ \li Qt.ApplicationInactive - The application is visible or partially visible, but not selected
+ to be in front, the user cannot interact with the application.
+ On desktop platforms, this typically means that the user activated
+ another application. On mobile platforms, it is more common to
+ enter this state when the OS is interrupting the user with for
+ example incoming calls, SMS-messages or dialogs. This is usually a
+ transient state during which the application is paused. The user
+ may return focus to your application, but most of the time it will
+ be the first indication that the application is going to be suspended.
+ While in this state, consider pausing or stopping any activity that
+ should not continue when the user cannot interact with your
+ application, such as a video, a game, animations, or sensors.
+ You should also avoid performing CPU-intensive tasks which might
+ slow down the application in front.
+ \li Qt.ApplicationSuspended - The application is suspended and not visible to the user. On
+ mobile platforms, the application typically enters this state when
+ the user returns to the home screen or switches to another
+ application. While in this state, the application should ensure
+ that the user perceives it as always alive and does not lose his
+ progress, saving any persistent data. The application should cease
+ all activities and be prepared for code execution to stop. While
+ suspended, the application can be killed at any time without
+ further warnings (for example when low memory forces the OS to purge
+ suspended applications).
+ \li Qt.ApplicationHidden - The application is hidden and runs in the background. This is the
+ normal state for applications that need to do background processing,
+ like playing music, while the user interacts with other applications.
+ The application should free up all graphical resources when entering
+ this state. A Qt Quick application should not usually handle this state
+ at the QML level. Instead, you should unload the entire UI and reload
+ the QML files whenever the application becomes active again.
+ \endlist
\row
\li \c application.layoutDirection
@@ -469,6 +505,7 @@ The following functions are also on the Qt object.
Note that when using QML without a QGuiApplication, the following properties will be undefined:
\list
\li application.active
+ \li application.state
\li application.layoutDirection
\endlist
*/
@@ -738,6 +775,7 @@ void QQmlEnginePrivate::init()
if (baseModulesUninitialized) {
qmlRegisterType<QQmlComponent>("QML", 1, 0, "Component"); // required for the Compiler.
registerBaseTypes("QtQml", 2, 0); // import which provides language building blocks.
+ qmlRegisterUncreatableType<QQmlLocale>("QtQml", 2, 2, "Locale", QQmlEngine::tr("Locale cannot be instantiated. Use Qt.locale()"));
QQmlData::init();
baseModulesUninitialized = false;
@@ -759,7 +797,7 @@ void QQmlEnginePrivate::init()
QQmlEngineDebugService::isDebuggingEnabled()) {
isDebugging = true;
QQmlEngineDebugService::instance()->addEngine(q);
- QV8DebugService::addEngine(v8engine());
+ QV4DebugService::instance()->addEngine(q);
QV8ProfilerService::initialize();
QQmlProfilerService::initialize();
QDebugMessageService::instance();
@@ -848,7 +886,7 @@ QQmlEngine::~QQmlEngine()
Q_D(QQmlEngine);
if (d->isDebugging) {
QQmlEngineDebugService::instance()->remEngine(this);
- QV8DebugService::removeEngine(handle());
+ QV4DebugService::instance()->removeEngine(this);
}
// Emit onDestruction signals for the root context before