Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

New SplitView: trouble when shrinking



  • This snippet shows what I believe is a plain use-case for the new SplitView from Controls 2:

    import QtQuick.Controls 2.13
    
    ApplicationWindow {
        visible: true
        SplitView {
            anchors.fill: parent
            orientation: Qt.Horizontal
            Control {
                SplitView.minimumWidth: 300
                background: Rectangle { color: "blue" }
            }
            Control {
                SplitView.minimumWidth: 300
                background: Rectangle { color: "green" }
            }
        }
    }
    

    Now move the split handle to the right as far as possible, then make the application window smaller.

    Note that SplitView does not care at all that the constraints are still met when the size of the SplitView reduces. The right child (including the split handle) can be moved outside the visible area completely.

    Am I doing something wrong? Is this a bug? Is there a workaround?



  • You are right, I had same problem and I think SplitView has lots of bugs

    • I solved the problem with this
    import QtQuick 2.13
    import QtQuick.Controls 2.13
    
    ApplicationWindow {
        width: 300
        height: 300
        visible: true
        SplitView {
            anchors.fill: parent
            orientation: Qt.Horizontal
            Control {
                id: control1
                SplitView.minimumWidth: 10
                SplitView.maximumWidth : parent.width - control2.width
                background: Rectangle { color: "blue" }
            }
            Control {
                id: control2
                SplitView.minimumWidth: 10
                background: Rectangle { color: "green" }
            }
        }
    }
    

    Don't know better solution!
    it seems SplitView has lots of bugs



  • Thank you, that looks like a good workaround! However, I share your view that the new SplitView still has way to go before it can be used without issues...


Log in to reply