On 18 October 2013 16:43, Franck Routier (perso) <a...@mecadu.org> wrote:
> 2) create a function in the gridview, and call it in the delegate onClicked
> handler. But then, I could find a way the pass a reference to the delegate
> (using this keyword resulted in an undefined variable).

Hi Franck,


I think you should be able to get what you're after with the following
- assuming you have a reference to your 'detail page' (lets call it
'detailPage'):


On your detail page, define a (variant) property:

Page {
    id: detailPage
    property variant myModel

    PageHeader {
        title: detailPage.myModel ? detailPage.myModel.title : 'Detail Page'
    }
}


On your grid page, for the grid delegate onclicked event:

        onClicked: {
            detailPage.myModel = modelData;
            pageStack.push(detailPage);
        }


Hope that helps!


-- 
Matt
m...@mattaustin.me.uk
http://mattaustin.me.uk/
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to