Qt World Summit: Register Today!

Very strange/bugged SplitView behavior

  • Hi,

    I'm using a SplitView like this:
    import QtQuick 2.4
    import QtQuick.Controls 1.3
    import QtQuick.Layouts 1.1

    Rectangle {
    id: root
    width: 600
    height: 600
    visible: true
    color: "yellow"

    SplitView {
        orientation: Qt.Vertical
        anchors.fill: parent
        handleDelegate: Rectangle {
            color: "black"
            height: 5
        Rectangle {
            color: "blue"
            Layout.fillHeight: true
            Layout.minimumHeight: 100
            Layout.maximumHeight: 400
        Rectangle {
            Layout.minimumHeight: 100
            Layout.maximumHeight: root.height


    #include <QApplication>
    #include <QQuickView>

    int main(int argc, char *argv[])
    QApplication app(argc, argv);

    QQuickView* pView = new QQuickView;
    return app.exec();


    And I realized some strange not to say bugged behaviors:

    1. On start of the program the "red"-Rectangle is only 100 pixel high and the lower port is yellow so the root object shines trough
      (2.) As soon as I move the handle to the top the to "red"-Rectangle covers the lower part of the Window as intended (so thats is actually fine not bugged)
    2. Moving the handle down works fine till the maxHeight of the "blue"-Rectangle is reached. If I move it further down the "red"-Rectangle starts to shrink and the yellow area appears again till the "red"-Rectangle reaches its minHeight
    3. Some times it is possible to move the handle off the middle of the split view. It than remains where ever it was dropped and in in its place yellow so the background is visible

    It is important to flag the "blue"-Rectangle with "Layout.fillHeight: true" so on resizing the window this part of the SplitView gets resized first and only if it hits its min/maxHeight the "red"-Rectangle gets resized.

    From http://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html#details :
    "As the fillWidth item will automatically be resized to fit the extra space, explicit assignments to width and height will be ignored (but Layout.minimumWidth and Layout.maximumWidth will still be respected)."
    It seams legal to do what I try to do here, but still it doesn't work

    Can someone pleas confirm this behavior?
    And more important is this a bug or am I doing something wrong here?

    Thanks a lot for your help

  • Hi there,
    does some one yet look into this or was it forgotten during the forum migration?

    Also how can I fix the code Blocks to have correct highlighting?


Log in to reply