aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2/doc/snippets/qtquickcontrols2-tabbar-flickable.qml
blob: 3851b226bd75c8469a23eec460fe8cacbe81de09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

import QtQuick
import QtQuick.Controls

Item {
    width: 360
    height: bar.height

//! [1]
TabBar {
    id: bar
    width: parent.width

    Repeater {
        model: ["First", "Second", "Third", "Fourth", "Fifth"]

        TabButton {
            text: modelData
            width: Math.max(100, bar.width / 5)
        }
    }
}
//! [1]
}