April 16, 2011

Luca Luca
Ant Farmer
589 posts

GridView && horizontal scroll [Solved]

 

Hi all,
I have a GridView in my QML project.
The GridView is populated by a query model.
The grid has a fixed size and there are a lot of element so I need to scroll down and right.

The problem is that I can scroll down with mouse but not left-right.

This is my qml file:

  1. import QtQuick 1.0
  2. import Qt 4.7
  3.  
  4. Rectangle {
  5.     //    color: "lightblue"
  6.     width: 600; height: 600
  7.     Component {
  8.         id: name_delegate
  9.         Text {
  10.             text: display
  11.         }
  12.     }
  13.  
  14.     GridView {
  15.         cellWidth: 80; cellHeight: 80
  16.         anchors.margins: 10
  17.         anchors.fill: parent
  18.         model: queryModel
  19.         delegate: name_delegate
  20.     }
  21.  
  22. }

Is it possible?

2 replies

April 16, 2011

Luca Luca
Ant Farmer
589 posts

I found it.
If usefull for someone:

  1. GridView {
  2.             cellWidth: 80; cellHeight: 80
  3.             anchors.margins: 10
  4.             anchors.fill: parent
  5.             model: queryModel
  6.             delegate: name_delegate
  7.            
  8.             flickableDirection: Flickable.HorizontalAndVerticalFlick
  9.         }

April 16, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

Please, don’t forget to mark thread as [solved]

 
  ‹‹ QML MouseArea signal onPressed is not avaible for signals forwarding      Issue about sending an event to the QGraphicsScene/QML code. ››

You must log in to post a reply. Not a member yet? Register here!