diff options
author | Otto Ryynänen <[email protected]> | 2025-03-31 10:18:10 +0300 |
---|---|---|
committer | Otto Ryynänen <[email protected]> | 2025-04-04 19:31:49 +0300 |
commit | 0e92a8e0683e2d388a61aac85509a8efbc16cd01 (patch) | |
tree | 3b5588fb8f6e7ebdeff23b1cb6867941e00cdf51 /examples/quick/models/threadedfetchmore/ContactBookDelegate.qml | |
parent | a951832b74749cde7832ee906df087ac857f5cbd (diff) |
Introduce threaded fetchmore example
Added an example of combining QThread and QAbstractItemModel - a feat
that our customers ask every now and then
Task-number: QTBUG-135351
Pick-to: 6.8 6.9
Change-Id: I476e7121361e4d85c2d87eb663f0389a337a3085
Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'examples/quick/models/threadedfetchmore/ContactBookDelegate.qml')
-rw-r--r-- | examples/quick/models/threadedfetchmore/ContactBookDelegate.qml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/examples/quick/models/threadedfetchmore/ContactBookDelegate.qml b/examples/quick/models/threadedfetchmore/ContactBookDelegate.qml new file mode 100644 index 0000000000..b93cb4aa9c --- /dev/null +++ b/examples/quick/models/threadedfetchmore/ContactBookDelegate.qml @@ -0,0 +1,44 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +Rectangle { + color: "white" + border.width: model.isLoadingElement ? 0 : 1 + border.color: "black" + implicitHeight: 50 + RowLayout { + anchors.fill: parent + spacing: 5 + BusyIndicator { + Layout.alignment: Qt.AlignHCenter + implicitHeight: 30 + implicitWidth: implicitHeight + visible: model.isLoadingElement + } + Label { + font.pixelSize: 30 + font.bold: true + text: model.number + visible: !model.isLoadingElement + } + ColumnLayout { + implicitHeight: 40 + Layout.fillWidth: true + Layout.fillHeight: true + Layout.margins: 3 + visible: !model.isLoadingElement + Label { + font.pixelSize: 16 + text: model.title + } + Label { + font.pixelSize: 14 + text: model.subtitle + } + } + } +} |