Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.10
- import QtQuick.Window 2.10
- import QtQuick.Controls 2.3
- ApplicationWindow{
- visible: true;
- width: 1280;
- height: 720;
- Row {
- anchors.fill: parent;
- TabBar {
- id: tabBar
- currentIndex: 0
- width: parent.width - addButton.width - btnDelete.width
- TabButton { text: "TabButton" }
- }
- Component {
- id: tabButton
- TabButton { text: "TabButton" }
- }
- Button {
- id: addButton
- text: "+"
- flat: true
- onClicked: {
- tabBar.addItem(tabButton.createObject(tabBar))
- console.log("added:", tabBar.itemAt(tabBar.count - 1))
- }
- }
- Button {
- id: btnDelete
- text: "-"
- flat: true
- onClicked: {
- tabBar.removeItem(tabBar.itemAt(tabBar.count-1));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment