KCMUtils

ScrollViewKCM.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 org.kde.kcmutils as KCMUtils
9
10/**
11 * This component is intended to be used as the root item for KCMs that are based upon a list view or another vertical flickable.
12 * It contains a ScrollView as its main item.
13 * It is possible to specify a header and footer component.
14 * @code
15 * import org.kde.kcmutils as KCMUtils
16 *
17 * KCMUtils.ScrollViewKCM {
18 * header: Item { }
19 * view: ListView { }
20 * footer: Item { }
21 * }
22 * @endcode
23 */
24KCMUtils.AbstractKCM {
25 id: root
26
27 /**
28 * view: ScrollView
29 * Exposes the internal flickable
30 */
31 property alias view: scroll.view
32
33 /**
34 * framedView: bool
35 * Whether to draw a frame around the KCM's inner scrollable list view.
36 * Default: false
37 *
38 * @since 5.90
39 */
40 framedView: false
41
42 onViewChanged: {
43 if (view) {
44 // Deliberately don't take separators into account, because those are opaque anyway
45 view.clip = Qt.binding(() => __headerContentVisible() || __footerContentVisible());
46 }
47 }
48
49 KCMUtils.ScrollView {
50 id: scroll
51 anchors.fill: parent
52 framedView: root.framedView
53 }
54}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.