PDA

View Full Version : Adding Event to Rows in ListView



Mathan
20th September 2016, 12:15
Hi,

I want to show the list of items, Rightnow, I am using ListView.
Query:
How to add an event for the row? Since I want to get the productId which is listed in ListView.

Is there any equivalent in Qt as GridView in .Net?

anda_skoa
20th September 2016, 17:31
What do you mean with "add an event for the row"?

An event is something that is happening, what is the trigger or your event?

Also the QtQuick GridView is called GridView :)

Cheers,
_

Mathan
21st September 2016, 09:39
Hi anda_skoa,

I meant the event when fires at row clicked, as if in Gridview in .net

Query: I will list the product in the listview, Now i want to fetch the ProductId when row of the listview is clicked.


Thanks in advance.

anda_skoa
21st September 2016, 20:11
Just add a MouseArea into the delegate where you need to detect clicks.

Cheers,
_