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. Delete Model when Delegate gets Deleted.

Delete Model when Delegate gets Deleted.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 316 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
    Anup deshpande
    wrote on last edited by
    #1

    Hi,
    I have a LISTVIEW_1 with model "A" inherited from QAbstractListModel .
    I have 1000 models in my model "A" which are also inherited from QAbstractListModel .
    The delegate for LISTVIEW_1 is again a ListView. Which means i have a ListView inside a ListView.
    Each of these delegate list views are associated with model.
    When ever i scroll LISTVIEW_1, delegates(these are also list view) are created and destroyed.
    When the delegates are deleted, can I delete Model at the back end when ever delegate gets deleted using delegate index.

    My assumption is that when the delegates are deleted, corresponding model object can be deleted safely.

    Is that ok delete the back end object when the corresponding delegates gets deleted ?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      If the delegates itself is deleted, then there is no use of its back data object at UI side. I feel you safely delete the object at the back. Only thing is that you need to create the same object again when requested by the UI.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      2

      • Login

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