Results 1 to 4 of 4

Thread: Adding Event to Rows in ListView

  1. #1
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Adding Event to Rows in ListView

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Adding Event to Rows in ListView

    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,
    _

  3. #3
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Adding Event to Rows in ListView

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Adding Event to Rows in ListView

    Just add a MouseArea into the delegate where you need to detect clicks.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    Mathan (22nd September 2016)

Similar Threads

  1. Adding CheckBoxes In ListView in Qt-4
    By Ketan Shah in forum Newbie
    Replies: 4
    Last Post: 25th September 2014, 15:06
  2. adding radio button in listview
    By phillip_Qt in forum Qt Programming
    Replies: 4
    Last Post: 8th July 2013, 08:07
  3. How to set event click Custom ListView
    By jindoniit in forum Newbie
    Replies: 14
    Last Post: 13th June 2011, 04:06
  4. Adding rows to Tableview
    By codeman in forum Qt Programming
    Replies: 1
    Last Post: 2nd October 2009, 10:27
  5. adding rows to tablewidget
    By reshma in forum Qt Programming
    Replies: 4
    Last Post: 12th March 2009, 13:40

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.