PDA

View Full Version : Problem using Flickable in QML?



tanthinh1510
15th May 2015, 04:29
I create simple example using flickable and I had problem:
I only want image show in Flickable Area. Outside Flickable Area, image is hide.
It's show in image below.

ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
visible: true
Rectangle{
id: main
anchors.fill: parent
color: "orange"
}

Flickable {
anchors.centerIn: main
width: 200; height: 200
contentWidth: image.width; contentHeight: image.height

Image {
id: image;
source: "qrc:///bigImage.jpg"
}
}

}
Image: https://www.dropbox.com/s/76h8n65bcem09sg/flickable.jpg?dl=0

wysota
15th May 2015, 06:27
Set "clip" property of the flickable to true.

tanthinh1510
15th May 2015, 07:08
Set "clip" property of the flickable to true.

Thanks so much! it's work fine.