I have a very basic QML file that I wrote in QT Creator. When I open it in the Design tab, it looks correct. When I compile and run the application, it is completely different and incorrect.
Design View: This is what appears in the Design Tab
Compiled App: This is the compiled app
Below is the code for the QML application.
import QtQuick 6.0
import QtQuick.Window 6.0
import QtQuick.Controls 6.0
Window {
width: 640
height: 480
visible: true
title: qsTr("Mamba Test Suite")
Column{
TabBar{
property int numTabs: 3
width:parent.width
id:topTab
currentIndex:btmswipe.currentIndex
Repeater {
model: ["Autocal","FLIN","4 path read"]
TabButton {
text: modelData
width: Math.max(100, topTab.width / topTab.numTabs)
}
}
}
SwipeView{
id:btmswipe
currentIndex: topTab.currentIndex
AutoCalPage{}
Rectangle{
id:flinPagePlaceholder
Text {
id: name
text: qsTr("Placeholder")
}
}
PathreadPage{}
}
}
}
Any help is greatly appreciated. I am new to QT and I'm attempting to learn.
I've tried changing the heights and width of specific elements. I've tried adding various Columns and Rows around the TabBar.
I found this page which led me to look at the parent of the repeater.
Once I removed the Column as the parent of the repeater, This got a lot better.