[SailfishDevel] connect gridview on delegates click signal

Franck Routier (perso) alci at mecadu.org
Fri Oct 18 08:43:09 UTC 2013


Firstly, I am really just trying to learn Qt, and I am not sure it is 
specific enough to be asked here, if not just tell me...

Anyway, I am using SailfishGridView (but it must be the same with 
standard GridView), with a ListModel, and a delegate component, in Qt Quick.
What I want to achieve is just this:
- display a page with a list of items (cards)
- when the user clicks on an item, display another page with the detail 
of the item

So, technically, I would like to connect the GridView to the onClicked 
signal of the delegates, and have a reference to the specific delegate 
that issued the signal (to be able to push another page, with the context).
I tried two approaches:
1) try to connect the gridview to the signal, but I don't have any 
handle/reference to the delegates. I could do this
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).

Thanks for any pointer.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4237 bytes
Desc: Signature cryptographique S/MIME
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131018/2dffcd94/attachment.bin>

More information about the Devel mailing list