KCMUtils

ScrollView.qml
1/*
2 SPDX-FileCopyrightText: 2018 Marco Martin <mart@kde.org>
3 SPDX-FileCopyrightText: 2023 ivan tkachenko <me@ratijas.tk>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8import QtQuick
9import QtQuick.Controls as QQC2
10import org.kde.kirigami as Kirigami
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 * @code
18 * import org.kde.kcmutils as KCMUtils
19 *
20 * KCMUtils.ScrollView {
21 * view: ListView { }
22 * }
23 * @endcode
24 * @see GridViewKCM
25 */
26QQC2.ScrollView {
27 id: scroll
28
29 /**
30 * view: GridView
31 * Exposes the internal flickable
32 */
33 property Flickable view
34 property bool framedView: true
35
36 contentItem: view
37 onViewChanged: {
38 view.parent = scroll;
39 if (!view.KeyNavigation.up) {
40 view.KeyNavigation.up = Qt.binding(() => root.globalToolBarItem);
41 }
42 }
43
44 activeFocusOnTab: false
45 Kirigami.Theme.colorSet: Kirigami.Theme.View
46 Kirigami.Theme.inherit: false
47
48 Component.onCompleted: {
49 if (background) {
50 background.visible = Qt.binding(() => framedView);
51 }
52 }
53
54 QQC2.ScrollBar.horizontal.visible: false
55}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:13:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.