Hello all,
I have a strange behavior in my application. My gridview seems to get 
outside it's container no matter how deep that container is. Is this a 
bug? Is there a way to tell it to stay inside a certain item and not get 
out of it when you drag of it. What I want is that if threre are lots of 
items and you drag of the grid you get to scroll but inside the 
container, not getting outside of it.

Bellow is the code:
import Qt 4.6

Rectangle{
    width: 800
    height: 480
    color: "white";

    ListModel {
         id: contactModel
         ListElement {
             name: "Bill Smith"
             number: "555 3264"
             portrait: "pics/portrait.png"
         }
         ListElement {
             name: "Jim Williams"
             number: "555 5673"
             portrait: "pics/portrait.png"
         }
         ListElement {
             name: "John Brown"
             number: "555 8426"
             portrait: "pics/portrait.png"
         }
         ListElement {
             name: "Sam Wise"
             number: "555 0473"
             portrait: "pics/portrait.png"
         }
     }
    Component {
         id: highlight
         Rectangle {
             color: "lightsteelblue"
             width: 70;
             height: 70;
             Text{ text: name }
             radius: 5
         }
     }

    Rectangle{
        id: topBar;
        height: 50;
        anchors.top: parent.top;
        anchors.left: parent.left;
        anchors.right: parent.right;
        color: "black";
    }
    Item{
        id: item1
        anchors.top: topBar.bottom;
        anchors.left: parent.left;
        anchors.right: parent.right;
        anchors.bottom: parent.bottom;

        GridView {
            id: grid;
            anchors.fill: item1;
            model: contactModel;
            delegate: highlight;
            cellWidth: 80; cellHeight: 80

        }
    }



}

BR,
Cristi
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to