diff options
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index e1fa97b52f..af94ece496 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -65,6 +65,7 @@ #include <QtCore/qmetaobject.h> #include <QDebug> #include <QtCore/qcoreapplication.h> +#include <QtCore/qcryptographichash.h> #include <QtCore/qdir.h> #include <QtCore/qmutex.h> #include <QtCore/qthread.h> @@ -564,7 +565,7 @@ The following functions are also on the Qt object. \l{Screen} attached object. In practice the array corresponds to the screen list returned by QGuiApplication::screens(). In addition to examining properties like name, width, height, etc., the array elements can also be - assigned to the targetScreen property of Window items, thus serving as an + assigned to the screen property of Window items, thus serving as an alternative to the C++ side's QWindow::setScreen(). This property has been added in Qt 5.9. @@ -585,7 +586,7 @@ The following functions are also on the Qt object. \li application.font \endlist - \sa Screen, Window, Window.targetScreen + \sa Screen, Window, Window.screen */ /*! @@ -760,7 +761,7 @@ class QQmlThreadNotifierProxyObject : public QObject public: QPointer<QObject> target; - virtual int qt_metacall(QMetaObject::Call, int methodIndex, void **a) { + int qt_metacall(QMetaObject::Call, int methodIndex, void **a) override { if (!target) return -1; @@ -1038,7 +1039,7 @@ QQmlEngine::~QQmlEngine() /*! \fn void QQmlEngine::exit(int retCode) This signal is emitted when the QML loaded by the engine would like to exit - from the event loop with the specified return code. + from the event loop with the specified return code \a retCode. \since 5.8 \sa quit() @@ -2178,6 +2179,27 @@ QString QQmlEngine::offlineStoragePath() const return d->offlineStoragePath; } +/*! + Returns the file path where a \l{QtQuick.LocalStorage}{Local Storage} + database with the identifier \a databaseName is (or would be) located. + + \sa LocalStorage.openDatabaseSync() + \since 5.9 +*/ +QString QQmlEngine::offlineStorageDatabaseFilePath(const QString &databaseName) const +{ + Q_D(const QQmlEngine); + QCryptographicHash md5(QCryptographicHash::Md5); + md5.addData(databaseName.toUtf8()); + return d->offlineStorageDatabaseDirectory() + QLatin1String(md5.result().toHex()); +} + +QString QQmlEnginePrivate::offlineStorageDatabaseDirectory() const +{ + Q_Q(const QQmlEngine); + return q->offlineStoragePath() + QDir::separator() + QLatin1String("Databases") + QDir::separator(); +} + QQmlPropertyCache *QQmlEnginePrivate::createCache(QQmlType *type, int minorVersion) { QList<QQmlType *> types; |