Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Different listviews , one model
Forum Update on Monday, May 27th 2025

Different listviews , one model

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 304 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Abdulmueez
    wrote on last edited by
    #1

    I have a c++ QAbstractItemModel that i'm using to populate different list views with the help of a delegate model in different ways, I'll like to add a delete button, but the problem is I'm having a problem getting the right index to be deleted as I'm only familiar with doing it with only one listView.

    So, in short how do I get the exact index of the item(it's index in the model) when it's clicked on, solutions I have seen involve using the ListView to get the index but the index usually varies from the intended index as it's filtered.
    Any examples or guide on this please? Thank you.

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      https://doc.qt.io/qt-5/modelview.html
      is a good read and is the fundament of using model view usage.

      there is a list of references to books with specific examples too.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved