TristanV
22nd June 2015, 19:59
Hi,
I am trying to create a scroll area which I can scroll up and down through using arrow keys. I have been able to scroll using the mouse, but not the keyboard. Any help would be appreciated.
import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Controls 1.2
import custom.sdk 1.0
Window {
width: 1280
height: 720
visible: true
Rectangle{
anchors.fill: parent
color: "#021d3a"
ScrollView{
x: 100
y: 100
width: 1080
height:600
focus:true
contentItem: Text{
width:1000
wrapMode: Text.WordWrap
color: "white"
font.family:"LatoRegular"
font.pointSize: 20
text:"Test\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTe st\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest \nTest\nTest\nTest\nTest\nTest\n"
}
}
}
}
I am trying to create a scroll area which I can scroll up and down through using arrow keys. I have been able to scroll using the mouse, but not the keyboard. Any help would be appreciated.
import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Controls 1.2
import custom.sdk 1.0
Window {
width: 1280
height: 720
visible: true
Rectangle{
anchors.fill: parent
color: "#021d3a"
ScrollView{
x: 100
y: 100
width: 1080
height:600
focus:true
contentItem: Text{
width:1000
wrapMode: Text.WordWrap
color: "white"
font.family:"LatoRegular"
font.pointSize: 20
text:"Test\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTe st\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest \nTest\nTest\nTest\nTest\nTest\n"
}
}
}
}