I'm am trying to get a TableView to scroll horizontally. I've gotten the horizontal to scroll; that was fairly straightforward. But horizontally, when the columns are wider than the TableView, they are simply cut off as oppossed to be scrolled. The documentation for TableView indicates that one of the features of the class is to add scrollbars and even shows an image with the vertical, however it doesn't show a horizontal scroll bar (nor did I stumble across an example). I assume that the TableView is capable of it based on the doc and the fact that it inherits from ScrollView.
In debugging this, I stripped it down into the simplest case I could think of to reproduce this. I tested it right next to a ScrollView that successfully scrolls horizontally. Since TableView inherits from ScrollView, I'd assume that a similar construction would promt horizontal scrolling, but no cigar. I assume I'm missing something small.
Any thoughts why the following code scrolls for ScrollView but not TableView? I'm using Qt 5.2.
import QtQuick 2.0
import QtQuick.Controls 1.1
Item {
width: 500
height: 500
TableView{
id: table
model: 5
width: 300
height: parent.height/2
headerVisible: false
TableViewColumn{
width: 700
delegate: Text{
// Hipster Ipsum
text: "Pickled occupy stumptown bitters drinking vinegar. Viral scenester Tonx DIY, skateboard craft beer YOLO. Pinterest tote bag beard butcher Brooklyn asymmetrical. Mlkshk tote bag locavore viral, occupy typewriter craft beer meggings chia PBR&B pickled. Tousled flexitarian authentic raw denim scenester hashtag. Narwhal shabby chic sustainable, Tumblr Neutra kogi disrupt Vice chia McSweeney's distillery. Banjo artisan vegan food truck, salvia mumblecore leggings ennui mlkshk art party."
}
}
}
ScrollView{
id: scroll
frameVisible: true
width: 300
height: parent.height/2
anchors.top: table.bottom
Rectangle{
height: scroll.height-17
width: 700
color: "yellow"
border.color: "red"
Text{
// Hipster Ipsum
text: "Pickled occupy stumptown bitters drinking vinegar. Viral scenester Tonx DIY, skateboard craft beer YOLO. Pinterest tote bag beard butcher Brooklyn asymmetrical. Mlkshk tote bag locavore viral, occupy typewriter craft beer meggings chia PBR&B pickled. Tousled flexitarian authentic raw denim scenester hashtag. Narwhal shabby chic sustainable, Tumblr Neutra kogi disrupt Vice chia McSweeney's distillery. Banjo artisan vegan food truck, salvia mumblecore leggings ennui mlkshk art party."
}
}
}
}
import QtQuick 2.0
import QtQuick.Controls 1.1
Item {
width: 500
height: 500
TableView{
id: table
model: 5
width: 300
height: parent.height/2
headerVisible: false
TableViewColumn{
width: 700
delegate: Text{
// Hipster Ipsum
text: "Pickled occupy stumptown bitters drinking vinegar. Viral scenester Tonx DIY, skateboard craft beer YOLO. Pinterest tote bag beard butcher Brooklyn asymmetrical. Mlkshk tote bag locavore viral, occupy typewriter craft beer meggings chia PBR&B pickled. Tousled flexitarian authentic raw denim scenester hashtag. Narwhal shabby chic sustainable, Tumblr Neutra kogi disrupt Vice chia McSweeney's distillery. Banjo artisan vegan food truck, salvia mumblecore leggings ennui mlkshk art party."
}
}
}
ScrollView{
id: scroll
frameVisible: true
width: 300
height: parent.height/2
anchors.top: table.bottom
Rectangle{
height: scroll.height-17
width: 700
color: "yellow"
border.color: "red"
Text{
// Hipster Ipsum
text: "Pickled occupy stumptown bitters drinking vinegar. Viral scenester Tonx DIY, skateboard craft beer YOLO. Pinterest tote bag beard butcher Brooklyn asymmetrical. Mlkshk tote bag locavore viral, occupy typewriter craft beer meggings chia PBR&B pickled. Tousled flexitarian authentic raw denim scenester hashtag. Narwhal shabby chic sustainable, Tumblr Neutra kogi disrupt Vice chia McSweeney's distillery. Banjo artisan vegan food truck, salvia mumblecore leggings ennui mlkshk art party."
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks