import QtQuick 2.7 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 ApplicationWindow { visible: true width: 640 height: 530 title: qsTr("blachat") StackLayout { id: swipeView anchors.fill: parent currentIndex: channel_tabs.currentIndex IrcChannel { } } Component { id: tabButton TabButton { text: "TabButton" } } footer: TabBar { id: channel_tabs objectName: "channel_tabs" TabButton { text: "a" } function add_channel(channel){ var newTab = tabButton.createObject(channel_tabs, {"text": channel}) channel_tabs.addItem(newTab) var newChannel = Qt.createComponent("Page1.qml").createObject(swipeView, {"objectName": "channel"+channel}) } } }