I have the following QML code:
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
Window {
id: win
width: 1024
height: 768
visible: true
ScrollView {
id:scrollView
anchors.fill: parent
Rectangle{
id:rect
z:5
color:"red"
width: 2048
height: win.height
border{
color: "black"
width: 2
}
}
}
}
In this code the larger Rectangle
makes the horizontal scrollbar correctly appear. However, since the scrollbar takes some height from the window, the vertical scrollbar appears too.
How can I make the Rectangle
fill only available space in my ScrollView
so that vertical scrollbar won't show up? Using something like win.height - <someNumber>
is not acceptable. Adding verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff
is also not acceptable cause it hides some content on bottom of rect
.