diff options
Diffstat (limited to 'src/qmlmodels/doc')
17 files changed, 81 insertions, 25 deletions
diff --git a/src/qmlmodels/doc/qtqmlmodels.qdocconf b/src/qmlmodels/doc/qtqmlmodels.qdocconf index 35910b7c71..5c9c04a85a 100644 --- a/src/qmlmodels/doc/qtqmlmodels.qdocconf +++ b/src/qmlmodels/doc/qtqmlmodels.qdocconf @@ -35,5 +35,5 @@ navigation.qmltypespage = "Qt Qml Models QML Types" # suppress qdoc warnings for \instantiates entries spurious += "C\\+\\+ class .*\\\\instantiates .*" -# Fail the documentation build if there are more warnings than the limit +# Enforce zero documentation warnings warninglimit = 0 diff --git a/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel.qml b/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel.qml index a2f12d5567..51bba64534 100644 --- a/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel.qml +++ b/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel.qml @@ -1,8 +1,8 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![0] -import QtQuick 2.0 -import QtQml.Models 2.2 +import QtQuick +import QtQml.Models Rectangle { width: 200; height: 100 diff --git a/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel_rootindex/view.qml b/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel_rootindex/view.qml index b124bb7b2a..01abaf1909 100644 --- a/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel_rootindex/view.qml +++ b/src/qmlmodels/doc/snippets/delegatemodel/delegatemodel_rootindex/view.qml @@ -1,8 +1,8 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![0] -import QtQuick 2.0 -import QtQml.Models 2.2 +import QtQuick +import QtQml.Models ListView { id: view diff --git a/src/qmlmodels/doc/snippets/delegatemodel/delegatemodelgroup.qml b/src/qmlmodels/doc/snippets/delegatemodel/delegatemodelgroup.qml index 0325d7f7f3..1f55f0d193 100644 --- a/src/qmlmodels/doc/snippets/delegatemodel/delegatemodelgroup.qml +++ b/src/qmlmodels/doc/snippets/delegatemodel/delegatemodelgroup.qml @@ -1,8 +1,8 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![0] -import QtQuick 2.0 -import QtQml.Models 2.2 +import QtQuick +import QtQml.Models Rectangle { width: 200; height: 100 diff --git a/src/qmlmodels/doc/snippets/package/Delegate.qml b/src/qmlmodels/doc/snippets/package/Delegate.qml index 48edb90125..d671c15b26 100644 --- a/src/qmlmodels/doc/snippets/package/Delegate.qml +++ b/src/qmlmodels/doc/snippets/package/Delegate.qml @@ -1,7 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.0 +import QtQuick //! [0] Package { diff --git a/src/qmlmodels/doc/snippets/package/view.qml b/src/qmlmodels/doc/snippets/package/view.qml index e0c43dad55..4df31a8498 100644 --- a/src/qmlmodels/doc/snippets/package/view.qml +++ b/src/qmlmodels/doc/snippets/package/view.qml @@ -1,8 +1,8 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.0 -import QtQml.Models 2.1 +import QtQuick +import QtQml.Models Rectangle { id: root diff --git a/src/qmlmodels/doc/snippets/qml/listmodel/WorkerScript.qml b/src/qmlmodels/doc/snippets/qml/listmodel/WorkerScript.qml new file mode 100644 index 0000000000..4799878375 --- /dev/null +++ b/src/qmlmodels/doc/snippets/qml/listmodel/WorkerScript.qml @@ -0,0 +1,43 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick + +Rectangle { + color: "white" + width: 200 + height: 300 + + ListView { + anchors.fill: parent + model: listModel + delegate: Component { + Text { + required property string time + text: time + } + } + + ListModel { id: listModel } + + WorkerScript { + id: worker + source: "dataloader.mjs" + } + +// ![0] + Timer { + id: timer + interval: 2000; repeat: true + running: true + triggeredOnStart: true + + onTriggered: { + var msg = {'action': 'appendCurrentTime', 'model': listModel}; + worker.sendMessage(msg); + } + } +// ![0] + } +} + diff --git a/src/qmlmodels/doc/snippets/qml/listmodel/dataloader.mjs b/src/qmlmodels/doc/snippets/qml/listmodel/dataloader.mjs new file mode 100644 index 0000000000..eed1bca6f1 --- /dev/null +++ b/src/qmlmodels/doc/snippets/qml/listmodel/dataloader.mjs @@ -0,0 +1,13 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +// ![0] +WorkerScript.onMessage = function(msg) { + if (msg.action == 'appendCurrentTime') { + var data = {'time': new Date().toTimeString()}; + msg.model.append(data); + msg.model.sync(); // updates the changes to the list + } +} +// ![0] + diff --git a/src/qmlmodels/doc/snippets/qml/listmodel/listelements.qml b/src/qmlmodels/doc/snippets/qml/listmodel/listelements.qml index bab4aec6a2..e2a1525534 100644 --- a/src/qmlmodels/doc/snippets/qml/listmodel/listelements.qml +++ b/src/qmlmodels/doc/snippets/qml/listmodel/listelements.qml @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //! [document] -import QtQuick 2.0 +import QtQuick Item { width: 200; height: 250 diff --git a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-modify.qml b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-modify.qml index 3178abfcfd..99d6a3adc7 100644 --- a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-modify.qml +++ b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-modify.qml @@ -1,6 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.0 +import QtQuick Rectangle { width: 200; height: 200 diff --git a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-nested.qml b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-nested.qml index 15a5fc858f..8018f7b69f 100644 --- a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-nested.qml +++ b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-nested.qml @@ -1,6 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.0 +import QtQuick Rectangle { width: 200; height: 200 diff --git a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-simple.qml b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-simple.qml index 2640a38f13..8ba0a6d182 100644 --- a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-simple.qml +++ b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel-simple.qml @@ -1,7 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![0] -import QtQuick 2.0 +import QtQuick Rectangle { width: 200; height: 200 diff --git a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel.qml b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel.qml index 05deec06b6..3eefc4b9a5 100644 --- a/src/qmlmodels/doc/snippets/qml/listmodel/listmodel.qml +++ b/src/qmlmodels/doc/snippets/qml/listmodel/listmodel.qml @@ -1,7 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![0] -import QtQuick 2.0 +import QtQuick ListModel { id: fruitModel diff --git a/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-complex.qml b/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-complex.qml index ab44bf5696..70ce56f599 100644 --- a/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-complex.qml +++ b/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-complex.qml @@ -2,9 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![file] -import QtQuick 2.12 -import QtQuick.Window 2.12 -import Qt.labs.qmlmodels 1.0 +import QtQuick +import QtQuick.Window +import Qt.labs.qmlmodels Window { width: 400 diff --git a/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-delegatechooser.qml b/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-delegatechooser.qml index 45c6f1818d..5241317c4d 100644 --- a/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-delegatechooser.qml +++ b/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-delegatechooser.qml @@ -2,9 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![file] -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import Qt.labs.qmlmodels 1.0 +import QtQuick +import QtQuick.Controls +import Qt.labs.qmlmodels ApplicationWindow { width: 400 diff --git a/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml b/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml index e00ae6bfc0..0c9622c440 100644 --- a/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml +++ b/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml @@ -2,9 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause //![file] -import QtQuick 2.12 -import QtQuick.Window 2.12 -import Qt.labs.qmlmodels 1.0 +import QtQuick +import QtQuick.Window +import Qt.labs.qmlmodels Window { width: 400 diff --git a/src/qmlmodels/doc/src/qtqmlmodel.qdoc b/src/qmlmodels/doc/src/qtqmlmodel.qdoc index 321b3fd57b..f75530e93c 100644 --- a/src/qmlmodels/doc/src/qtqmlmodel.qdoc +++ b/src/qmlmodels/doc/src/qtqmlmodel.qdoc @@ -17,7 +17,7 @@ \endqml \note QtQml.Models module started at version 2.1 to match the version - of the parent module, \l{Qt QML}. + of the parent module, \l{Qt Qml}. In addition, Qt.labs.qmlmodels provides experimental QML types for models. To use these experimental types, import the module with the following line: |