KCMUtils

GridView.qml
1/*
2 SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7import QtQuick
8import QtQuick.Controls as QQC2
9import org.kde.kirigami as Kirigami
10import "private" as Private
11
12/**
13 * A ScrollView containing a GridView, with the default behavior about
14 * sizing and background as recommended by the user interface guidelines
15 * For most KControl modules, it's recommended to use instead the GridViewKCM
16 * component as the root element of your module.
17 * @see GridViewKCM
18 */
19QQC2.ScrollView {
20 id: scroll
21
22 /**
23 * view: GridView
24 * Exposes the internal GridView: in order to set a model or a delegate to it,
25 * use the following code:
26 * @code
27 * import org.kde.kcmutils as KCMUtils
28 *
29 * KCMUtils.GridView {
30 * view.model: kcm.model
31 * view.delegate: KCMUtils.GridDelegate { }
32 * }
33 * @endcode
34 */
35 property alias view: view
36 property bool framedView: true
37
38 activeFocusOnTab: false
39 Kirigami.Theme.colorSet: Kirigami.Theme.View
40 Kirigami.Theme.inherit: false
41
42 Component.onCompleted: {
43 if (background) {
44 background.visible = Qt.binding(() => framedView);
45 }
46 }
47
48 Private.GridViewInternal {
49 id: view
50 }
51 QQC2.ScrollBar.horizontal.visible: false
52}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:48:59 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.