Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Splitter not visible in Splitview within StackLayout
Forum Updated to NodeBB v4.3 + New Features

Splitter not visible in Splitview within StackLayout

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 343 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SietseAchteropS Offline
    SietseAchteropS Offline
    SietseAchterop
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • IntruderExcluderI Offline
      IntruderExcluderI Offline
      IntruderExcluder
      wrote on last edited by
      #2

      Your StackLayout have zero height, thats why it doesnt shows anything.

      SietseAchteropS 1 Reply Last reply
      0
      • IntruderExcluderI IntruderExcluder

        Your StackLayout have zero height, thats why it doesnt shows anything.

        SietseAchteropS Offline
        SietseAchteropS Offline
        SietseAchterop
        wrote on last edited by
        #3

        @IntruderExcluder Thanks!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved