Splitter not visible in Splitview within StackLayout
Solved
QML and Qt Quick
-
Hello list,
My app is an ApplicationWindow with a StackLayout as its main content.
One of the sub-pages is a Splitview.
That sub-page is correct and visible, but there is NO splitter visible of usable!Here the simplified main.qml
import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.12 ApplicationWindow { id: applicationWindow visible: true width: 400 height: 400 StackLayout { id: stackLayout width: parent.width currentIndex: tabBar.currentIndex Pieces { id: iets1 } ViewPiece { id: iets2 } } footer: TabBar { id: tabBar currentIndex: stackLayout.currentIndex TabButton { id: tabButton implicitHeight:20 text: qsTr("Setup pieces") } TabButton { id: tabButton1 implicitHeight:20 text: qsTr("View piece") } } }
And Pieces.qml
import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.12 Item { SplitView { id: splitView anchors.fill: parent Text { text: 'Pieces links' SplitView.preferredWidth: 200 } Text { text: 'Pieces rechts' } } }
If i change Pieces.qml into a visible ApplicationWindow and use it as the main qml-file it works!
This is on Linux/Debian/Buster.
What am I doing wrong? Thanks in advance.
Regards, Sietse -
Your StackLayout have zero height, thats why it doesnt shows anything.
-
Your StackLayout have zero height, thats why it doesnt shows anything.
@IntruderExcluder Thanks!