Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] do we need to free QstandardItem and QstandardItemModel ?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] do we need to free QstandardItem and QstandardItemModel ?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • X Offline
    X Offline
    XGuy
    wrote on last edited by
    #1

    i was wondering if we have to free pointers of type QstandardItem and QstandardItemModel?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      No you don't need to, the model takes ownership of the item, you can find more info "here":http://qt-project.org/doc/qt-4.8/qstandarditemmodel.html#setItem

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • X Offline
        X Offline
        XGuy
        wrote on last edited by
        #3

        Hi, thanks for your reply :-)
        so we should only delete the model itself?

        1 Reply Last reply
        0
        • X Offline
          X Offline
          XGuy
          wrote on last edited by
          #4

          i just found the answer on QStandardItemModel :-)
          yes we should delete it using slot deleteLater();
          have a look on:
          "Link1":http://qt-project.org/doc/qt-4.8/qabstractitemview.html#setModel
          "deleteLater()":http://qt-project.org/doc/qt-4.8/qobject.html#deleteLater

          1 Reply Last reply
          0

          • Login

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