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 2.7
8import QtQuick.Controls 2.2 as QQC2
9import org.kde.kirigami 2.3 as Kirigami
10import "private" as P
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 KCM
28 * KCM.GridView {
29 * view.model: kcm.model
30 * view.delegate: KCM.GridDelegate {...}
31 * }
32 * @endcode
33 */
34 property alias view: view
35 property bool framedView: true
36
37 activeFocusOnTab: false
38 Kirigami.Theme.colorSet: Kirigami.Theme.View
39 Kirigami.Theme.inherit: false
40
41 Component.onCompleted: {
42 if (background) {
43 background.visible = Qt.binding(() => framedView);
44 }
45 }
46
47 P.GridViewInternal {
48 id: view
49 }
50 QQC2.ScrollBar.horizontal.visible: false
51}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:56 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.