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

KDE's Doxygen guidelines are available online.