summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-06-17 11:54:16 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2011-06-17 11:54:16 (GMT)
commit2b39081bf101e53a70ff056d527dc3dfb8208bf0 (patch)
treea8e57489e18dbdd620b8880eda5c8e2d77049a07 /src/declarative/qml
parent5e1112ec04dcef671700e326186ca56b790f7e08 (diff)
parentc390312f8fbea14ac4df0c5185ca814054f448d8 (diff)
downloadQt-2b39081bf101e53a70ff056d527dc3dfb8208bf0.zip
Qt-2b39081bf101e53a70ff056d527dc3dfb8208bf0.tar.gz
Qt-2b39081bf101e53a70ff056d527dc3dfb8208bf0.tar.bz2
Merge branch '4.8' of scm.dev.nokia.troll.no:qt/qt
Conflicts: doc/src/declarative/righttoleft.qdoc examples/draganddrop/fridgemagnets/main.cpp examples/script/context2d/main.cpp
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativedirparser.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp6
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp14
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp3
-rw-r--r--src/declarative/qml/qperformancetimer.cpp55
5 files changed, 45 insertions, 35 deletions
diff --git a/src/declarative/qml/qdeclarativedirparser.cpp b/src/declarative/qml/qdeclarativedirparser.cpp
index d4abbee..1d4db40 100644
--- a/src/declarative/qml/qdeclarativedirparser.cpp
+++ b/src/declarative/qml/qdeclarativedirparser.cpp
@@ -240,7 +240,7 @@ QList<QDeclarativeDirParser::Component> QDeclarativeDirParser::components() cons
}
#ifdef QT_CREATOR
-QList<TypeInfo> QDeclarativeDirParser::typeInfos() const
+QList<QDeclarativeDirParser::TypeInfo> QDeclarativeDirParser::typeInfos() const
{
return _typeInfos;
}
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index b81f631..8679445 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -771,9 +771,6 @@ QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const
All required image providers should be added to the engine before any
QML sources files are loaded.
- Note that images loaded from a QDeclarativeImageProvider are cached
- by QPixmapCache, similar to any image loaded by QML.
-
\sa removeImageProvider()
*/
void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativeImageProvider *provider)
@@ -1716,9 +1713,6 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
qsreal w = ctxt->argument(2).toNumber();
qsreal h = ctxt->argument(3).toNumber();
- if (w < 0 || h < 0)
- return engine->nullValue();
-
return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
}
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index 559adf4..fa88c00 100644
--- a/src/declarative/qml/qdeclarativeimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -136,7 +136,8 @@ public:
Image providers that support QImage loading automatically include support
for asychronous loading of images. To enable asynchronous loading for an
- \l Image source, set \l Image::asynchronous to \c true. When this is enabled,
+ image source, set the \c asynchronous property to \c true for the relevant
+ \l Image, \l BorderImage or \l AnimatedImage object. When this is enabled,
the image request to the provider is run in a low priority thread,
allowing image loading to be executed in the background, and reducing the
performance impact on the user interface.
@@ -147,6 +148,17 @@ public:
\c true, the value is ignored and the image is loaded
synchronously.
+
+ \section2 Image caching
+
+ Images returned by a QDeclarativeImageProvider are automatically cached,
+ similar to any image loaded by the QML engine. When an image with a
+ "image://" prefix is loaded from cache, requestImage() and requestPixmap()
+ will not be called for the relevant image provider. If an image should always
+ be fetched from the image provider, and should not be cached at all, set the
+ \c cache property to \c false for the relevant \l Image, \l BorderImage or
+ \l AnimatedImage object.
+
\sa QDeclarativeEngine::addImageProvider()
*/
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index e806dbf..ae28049 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -183,6 +183,9 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name)
/*!
Creates a QDeclarativeProperty for the property \a name of \a obj
using the \l{QDeclarativeContext} {context} \a ctxt.
+
+ Creating a QDeclarativeProperty without a context will render some
+ properties - like attached properties - inaccessible.
*/
QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt)
: d(new QDeclarativePropertyPrivate)
diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp
index 9fc0d35..659a339 100644
--- a/src/declarative/qml/qperformancetimer.cpp
+++ b/src/declarative/qml/qperformancetimer.cpp
@@ -45,14 +45,15 @@
#include <sys/time.h>
#include <unistd.h>
#include <mach/mach_time.h>
-#elif defined(Q_OS_UNIX)
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
#elif defined(Q_OS_SYMBIAN)
#include <e32std.h>
#include <sys/time.h>
#include <hal.h>
+#include <hal_data.h>
+#elif defined(Q_OS_UNIX)
+#include <sys/time.h>
+#include <time.h>
+#include <unistd.h>
#elif defined(Q_OS_WIN)
#include <windows.h>
#endif
@@ -84,6 +85,29 @@ qint64 QPerformanceTimer::elapsed() const
return absoluteToNSecs(cpu_time - t1);
}
+////////////////////////////// Symbian //////////////////////////////
+#elif defined(Q_OS_SYMBIAN)
+
+static qint64 getTimeFromTick(quint64 elapsed)
+{
+ static TInt freq = 0;
+ if (!freq)
+ HAL::Get(HALData::EFastCounterFrequency, freq);
+
+ return (elapsed * 1000000000) / freq;
+}
+
+void QPerformanceTimer::start()
+{
+ t1 = User::FastCounter();
+}
+
+qint64 QPerformanceTimer::elapsed() const
+{
+ return getTimeFromTick(User::FastCounter() - t1);
+}
+
+
////////////////////////////// Unix //////////////////////////////
#elif defined(Q_OS_UNIX)
@@ -158,29 +182,6 @@ qint64 QPerformanceTimer::elapsed() const
return sec * Q_INT64_C(1000000000) + frac;
}
-////////////////////////////// Symbian //////////////////////////////
-#elif defined(Q_OS_SYMBIAN)
-
-static qint64 getTimeFromTick(quint64 elapsed)
-{
- static TInt freq;
- if (!freq)
- HAL::Get(HALData::EFastCounterFrequency, freq);
-
- // ### not sure on units
- return elapsed / freq;
-}
-
-void QPerformanceTimer::start()
-{
- t1 = User::FastCounter();
-}
-
-qint64 QPerformanceTimer::elapsed() const
-{
- return getTimeFromTick(User::FastCounter() - t1);
-}
-
////////////////////////////// Windows //////////////////////////////
#elif defined(Q_OS_WIN)