Hi
Even the documentation says TextArea supports scrolling , in fact it neither show scrollbars nor support it -- looks like incomplete implementation .
I found error that breaks scrolling in your code :
Flickable {
id: flick
width: parent.width
//height: changeLogArea.height ---- replace it with the line below
height: parent.height
............
the whole code would be like that :
Code:
import QtQuick 1.1
import com.nokia.meego 1.0
Page {
id: myShowChangeLogPage
Flickable {
id: flick
width: parent.width
//height: changeLogArea.height
height: parent.height
contentWidth: changeLogArea.paintedWidth
contentHeight: changeLogArea.paintedHeight
Rectangle {
color: "Red"
width: changeLogArea.width
height: changeLogArea.height
}
TextEdit {
id: changeLogArea
width: screen.width
height: 300
textFormat: Text.AutoText
wrapMode: TextEdit.Wrap
text: "1\n1\n1\n1\n2\n1\n1\n1\n1\n1\n3\n1\n1\n1\n4\n1\n1\n1\n1\n5\n1\n1\n1\n6\n1\n1\n1\n7\n1\n1\n1\n8\n1\n1\n1\n9\n1\n1\n1\n10"
}
}
ScrollBar {
scrollArea: flick;
width: 8
anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
}
}
and you will need to create ScrollBar.qml in your project with content shown below (taken from Symbian QComponents gitorius repo):
Code:
import QtQuick 1.1
Item {
id: container
property variant scrollArea
property variant orientation: Qt.Vertical
opacity: 0
function position()
{
var ny = 0;
if (container.orientation == Qt.Vertical)
ny = scrollArea.visibleArea.yPosition * container.height;
else
ny = scrollArea.visibleArea.xPosition * container.width;
if (ny > 2) return ny; else return 2;
}
function size()
{
var nh, ny;
if (container.orientation == Qt.Vertical)
nh = scrollArea.visibleArea.heightRatio * container.height;
else
nh = scrollArea.visibleArea.widthRatio * container.width;
if (container.orientation == Qt.Vertical)
ny = scrollArea.visibleArea.yPosition * container.height;
else
ny = scrollArea.visibleArea.xPosition * container.width;
if (ny > 3) {
var t;
if (container.orientation == Qt.Vertical)
t = Math.ceil(container.height - 3 - ny);
else
t = Math.ceil(container.width - 3 - ny);
if (nh > t) return t; else return nh;
} else return nh + ny;
}
Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.5 }
BorderImage {
source: "scrollbar.png"
border { left: 1; right: 1; top: 1; bottom: 1 }
x: container.orientation == Qt.Vertical ? 2 : position()
width: container.orientation == Qt.Vertical ? container.width - 4 : size()
y: container.orientation == Qt.Vertical ? position() : 2
height: container.orientation == Qt.Vertical ? size() : container.height - 4
}
states: State {
name: "visible"
when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally
PropertyChanges { target: container; opacity: 1.0 }
}
transitions: Transition {
from: "visible"; to: ""
NumberAnimation { properties: "opacity"; duration: 600 }
}
}
also you will need "scrollbar.png" --- have just dummy collored bar picture in png format with dimetion 4X4 pixels -- i cannot attach the file to that forum.
i hope it will help --- that is working for me