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. How To Delete an Item by knowing its WidgetItem? and Is it Safe to Delete a WidgetItem without Deleting the Item itself?

How To Delete an Item by knowing its WidgetItem? and Is it Safe to Delete a WidgetItem without Deleting the Item itself?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 156 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.
  • Y Offline
    Y Offline
    Yousef Alaa Hussain
    wrote on 15 Oct 2024, 20:53 last edited by
    #1

    Hello Everyone! I am a Beginner Qt Developer who started learning it 1 month ago.
    As you Can See at the line 106 in the Image Below:
    Screenshot from 2024-10-15 23-42-03.png
    at that line, I Deleted the tempyitemwidget Which is a widget item for an item in a qlistwidget.

    So Basically The Questions:

    1. Is it Safe and Fast to Delete the WidgetItem inside the item, instead of Deleting the Item itself?
    2. will The item be Deleted if its itemwidget is deleted?
    3. Is There any way to Find By Knowing its itemwidget only? And then at the End Delete it?

    Thanks for everyone!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ankou29666
      wrote on 15 Oct 2024, 21:50 last edited by ankou29666
      #2

      Hi

      please prefer posting your code as text rather than screenshot.

      Your questions are a little unclear to me, but if I understand it right, at least for the two first

      1. yes you can safely delete an object from within it's parent or from any other object, however, if you ever want an object to delete itself, I would rather suggest doing this->deletelater() ;
      2. no the deleter is not deleted
      3. please reformulate correctly
      1 Reply Last reply
      1

      1/2

      15 Oct 2024, 20:53

      • Login

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