diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-03 01:00:13 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-03 01:00:13 +0100 |
commit | bf0603fd03ade413036c7dba1ffe0e7ac9364fc9 (patch) | |
tree | b6329f629c5c0a19ca419671ee328725daec699f /src/imports | |
parent | bb7a5d0cb6e62fa411e8b66759bf6b798c3f68d9 (diff) | |
parent | 6b310e5f9a53c366fbb8fb78bd7c343aad4e0cdd (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I308b964d86ca01916f6af7d6e3f71557e3624eca
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/handlers/plugin.cpp | 17 | ||||
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 38 | ||||
-rw-r--r-- | src/imports/qtquick2/plugin.cpp | 2 | ||||
-rw-r--r-- | src/imports/shapes/qquickshape.cpp | 2 | ||||
-rw-r--r-- | src/imports/testlib/main.cpp | 2 |
5 files changed, 33 insertions, 28 deletions
diff --git a/src/imports/handlers/plugin.cpp b/src/imports/handlers/plugin.cpp index 026814541e..d1041d6539 100644 --- a/src/imports/handlers/plugin.cpp +++ b/src/imports/handlers/plugin.cpp @@ -50,23 +50,6 @@ static void initResources() QT_BEGIN_NAMESPACE -/*! - \qmlmodule Qt.labs.handlers 1.0 - \title Qt Quick Pointer Handlers - \ingroup qmlmodules - \brief Provides QML types for handling pointer events. - - This QML module contains types for handling pointer events, which are an abstraction - of mouse, touch and tablet events. - - To use the types in this module, import the module with the following line: - - \code - import Qt.labs.handlers 1.0 - \endcode -*/ - - //![class decl] class QtQuickHandlersPlugin : public QQmlExtensionPlugin { diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 5148b2f18f..88121df66c 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -97,7 +97,7 @@ class QQmlSqlDatabaseData : public QV8Engine::Deletable { public: QQmlSqlDatabaseData(QV4::ExecutionEngine *engine); - ~QQmlSqlDatabaseData(); + ~QQmlSqlDatabaseData() override; QV4::PersistentValue databaseProto; QV4::PersistentValue queryProto; @@ -611,7 +611,15 @@ May throw exception with code property SQLException.DATABASE_ERR or SQLException See example below. -\snippet qml/localstorage/dbtransaction.js 2 +\badcode + var db = LocalStorage.openDatabaseSync("ActivityTrackDB", "", "Database tracking sports activities", 1000000); + if (db.version == "0.1") { + db.changeVersion("0.1", "0.2", function(tx) { + tx.executeSql("INSERT INTO trip_log VALUES(?, ?, ?)", + [ "01/10/2016","Sylling - Vikersund", "53" ]); + } + }); +\endcode \section3 db.transaction(callback(tx)) @@ -621,7 +629,10 @@ you can call \e executeSql on \e tx to read and modify the database. If the callback throws exceptions, the transaction is rolled back. Below you will find an example of a database transaction which catches exceptions. -\snippet qml/localstorage/dbtransaction.js 0 + +\quotefromfile localstorage/localstorage/Database.js +\skipuntil dbInit() +\printto dbGetHandle In the example you can see an \c insert statement where values are assigned to the fields, and the record is written into the table. That is an \c insert statement with a syntax that is usual @@ -631,15 +642,24 @@ store them in a table. Let's suppose a simple example where we store trips in JSON format using \c date as the unique key. An example of a table that could be used for that purpose: -\snippet qml/localstorage/dbtransaction.js 3 +\badcode + create table trip_log(date text, data text) +\endcode The assignment of values to a JSON object: -\snippet qml/localstorage/dbtransaction.js 4 +\badcode + var obj = {description = "Vikersund - Noresund", distance = "60"} +\endcode In that case, the data could be saved in the following way: -\snippet qml/localstorage/dbtransaction.js 5 +\badcode + db.transaction(function(tx) { + result = tx.executeSQL("insert into trip_log values (?,?)", + ["01/11/2016", JSON.stringify(obj)]) + +\endcode \section3 db.readTransaction(callback(tx)) @@ -664,7 +684,9 @@ May throw exception with code property SQLException.DATABASE_ERR, SQLException.S See below for an example: -\snippet qml/localstorage/dbtransaction.js 1 +\quotefromfile localstorage/localstorage/Database.js +\skipto dbReadAll() +\printto dbUpdate(Pdate \section1 Method Documentation @@ -693,7 +715,7 @@ public: QQuickLocalStorage(QObject *parent=nullptr) : QObject(parent) { } - ~QQuickLocalStorage() { + ~QQuickLocalStorage() override { } Q_INVOKABLE void openDatabaseSync(QQmlV4Function* args); diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index 516b823856..147f01e81b 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -65,7 +65,7 @@ public: QQmlQtQuick2Module::defineModule(); } - ~QtQuick2Plugin() + ~QtQuick2Plugin() override { if (moduleDefined) QQmlQtQuick2Module::undefineModule(); diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp index f0fdebe162..067a54736f 100644 --- a/src/imports/shapes/qquickshape.cpp +++ b/src/imports/shapes/qquickshape.cpp @@ -1404,7 +1404,7 @@ void QQuickShapeRadialGradient::setFocalRadius(qreal v) Conical gradients interpolate colors counter-clockwise around a center point in Shape items. - \note The \l{ShapeGradient.spread}{spread mode} setting has no effect for + \note The \l{ShapeGradient::spread}{spread mode} setting has no effect for conical gradients. \note ConicalGradient is only supported in combination with Shape items. It diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index 41b5d1715c..45e9bd2cf6 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -73,7 +73,7 @@ public: :QObject(parent) {} - ~QuickTestUtil() + ~QuickTestUtil() override {} bool printAvailableFunctions() const { |