Warning, /frameworks/qqc2-desktop-style/tests/tabbar.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 David Edmundson <kde@davidedmundson.co.uk>
0003     SPDX-FileCopyrightText: 2021 Nate Graham <nate@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later
0006 */
0007 
0008 import QtQuick
0009 import QtQuick.Controls
0010 import QtQuick.Layouts
0011 
0012 Item {
0013     width: 400
0014     height: 300
0015 
0016     ColumnLayout {
0017         anchors.fill: parent
0018         anchors.margins: 20
0019 
0020         spacing: 0
0021 
0022         TabBar {
0023             id: tabView
0024 
0025             TabButton {
0026                 text: "White"
0027             }
0028             TabButton {
0029                 text: "Green"
0030             }
0031             TabButton {
0032                 text: "Blue"
0033             }
0034         }
0035 
0036         Frame {
0037             Layout.fillWidth: true
0038             Layout.fillHeight: true
0039 
0040             StackLayout { //or SwipeView + clip for animated?
0041                 anchors.fill: parent
0042 
0043                 currentIndex: tabView.currentIndex
0044 
0045                 Rectangle {
0046                     color: "white"
0047                 }
0048                 Rectangle {
0049                     color: "Green"
0050                 }
0051                 Rectangle {
0052                     color: "Blue"
0053                 }
0054             }
0055         }
0056     }
0057 }