Purpose

bluetoothplugin_config.qml
1/*
2 SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7import QtQuick
8import QtQuick.Layouts
9import QtQuick.Controls
10import org.kde.kirigami as Kirigami
11
12import org.kde.bluezqt as BluezQt
13
14ColumnLayout {
15 id: root
16
17 property var device: undefined
18
19 anchors.bottomMargin: Kirigami.Units.smallSpacing
20
21 Kirigami.Heading {
22 Layout.fillWidth: true
23 text: i18nd("purpose6_bluetooth", "Choose a device to send to:")
24 visible: list.count !== 0
25 level: 1
26 wrapMode: Text.Wrap
27 }
28
30 id: scroll
31
32 Layout.fillWidth: true
33 Layout.fillHeight: true
34
35 // Make sure we have space to show the placeholdermessage when no explicit size is set
36 contentHeight: list.count !== 0 ? implicitContentHeight : Kirigami.Units.gridUnit * 3
37
38 Component.onCompleted: scroll.background.visible = true
39
40 ListView {
41 id: list
42
43 // Don't select anything by default; make the user choose explicitly
44 currentIndex: -1
45
46 clip: true
47 model: BluezQt.DevicesModel { }
48
49 delegate: ItemDelegate {
50 width: ListView.view.width
51 text: Name
52 icon.name: Icon
53 onClicked: root.device = Ubi
54 checked: root.device === Ubi
55 highlighted: root.device === Ubi
56 }
57
59 anchors.centerIn: parent
60 width: parent.width - (Kirigami.Units.largeSpacing * 4)
61 visible: list.count === 0
62 text: i18nd("purpose6_bluetooth", "No devices found")
63 }
64 }
65 }
66}
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
QStringView level(QStringView ifopt)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QString name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:49:16 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.