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.

Qt Code:
  1. import QtQuick 2.0
  2. import QtQuick.Controls 1.1
  3.  
  4. Item {
  5. width: 500
  6. height: 500
  7.  
  8. TableView{
  9. id: table
  10. model: 5
  11. width: 300
  12. height: parent.height/2
  13. headerVisible: false
  14. TableViewColumn{
  15. width: 700
  16. delegate: Text{
  17. // Hipster Ipsum
  18. 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."
  19. }
  20. }
  21. }
  22.  
  23. ScrollView{
  24. id: scroll
  25. frameVisible: true
  26. width: 300
  27. height: parent.height/2
  28. anchors.top: table.bottom
  29.  
  30. Rectangle{
  31. height: scroll.height-17
  32. width: 700
  33. color: "yellow"
  34. border.color: "red"
  35.  
  36. Text{
  37. // Hipster Ipsum
  38. 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."
  39. }
  40. }
  41. }
  42. }
To copy to clipboard, switch view to plain text mode