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. Deleting Objects and Connections

Deleting Objects and Connections

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 8.7k 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
    Arukas
    wrote on last edited by
    #1

    If I dynamically create a QWidget and connect it via the connect function. Later when the dynamic object is deleted, is the connection deleted too? Or do I need to remove the connection myself? I haven't read anything that says the connections are deleted when the objects get deleted.

    I understand that the delete object can't cause a signal, but that doesn't mean the connection isn't still connected halfway. I just don't want to waste memory if i don't have too. Also I don't want to program with a paranoia, ie doing stuff "just to make sure". Which is a waste my time.

    -Thanks

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi,

      if an object is deleted, the connections from this object to others is deleted. And it emits a signal which leads to removing the signals connected to this object. This works.

      To achieve this, QObject has one signal:

      @
      void destroyed(QObject * = 0);
      @

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Arukas
        wrote on last edited by
        #3

        Did not know that. Figured it did, but now I know for sure.

        Thanks!

        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