Kirigami2

TabBarControl.qml
1 /*
2  * SPDX-FileCopyrightText: 2018 Marco Martin <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 import QtQuick 2.15
8 import QtQuick.Controls 2.15 as QQC2
9 import org.kde.kirigami 2.19 as Kirigami
10 
11 /**
12  * @warning This will probably be deprecated in KF6.
13  */
14 // TODO KF6 deprecated
15 QQC2.TabBar {
16  id: root
17  property Kirigami.PageRow pageRow: parent.pageRow
18 
19  Repeater {
20  id: mainRepeater
21  model: pageRow.depth
22  delegate: QQC2.TabButton {
23  anchors {
24  top:parent.top
25  bottom:parent.bottom
26  }
27  width: mainRepeater.count === 1 ? implicitWidth : Math.max(implicitWidth, Math.round(root.width/mainRepeater.count))
28  height: root.height
29  readonly property Kirigami.Page page: pageRow.get(modelData)
30  text: page ? page.title : ""
31  checked: modelData === pageRow.currentIndex
32  onClicked: pageRow.currentIndex = modelData;
33  }
34  }
35 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jan 29 2023 04:11:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.