1

I have a SplitView and inside this split view I have two elements (Rectangle (users) and one Item that contains a ColumnLayout (processes) ).

User can choose if he would like to see users or not. If he doesn't want to see users, then, I set rectangle width to 0 and he is able to see only processes, but problem is that in that window, there are two borders. One is from window, one is from SplitView.

Any idea how can I get rid of these double border?

skypjack
  • 49,335
  • 19
  • 95
  • 187
golobitch
  • 1,466
  • 3
  • 19
  • 38

1 Answers1

1

Try to set the visible attribute of your rectangle to false (instead of changing width to 0)

In the example you can change the visible left 'border' of the splitview (the border is not a border, it's the splitview slider between the first and the second element):

ApplicationWindow {

    title: qsTr("Hello World")
    width: 640
    height: 480
    visible: true

    SplitView {
        anchors.fill: parent

        Rectangle {
            id: rec
            width: 0
            height: parent.height
            visible: false
        }

        Rectangle {
            width: 200
            color:"red"
            height: parent.height
        }

        Button {
            text: "change left border of splitview"
            onClicked: {
                rec.visible = !rec.visible;
            }
        }
    }
}
schoeffi
  • 96
  • 6