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. Bug free programming with Qt:
Forum Updated to NodeBB v4.3 + New Features

Bug free programming with Qt:

Scheduled Pinned Locked Moved General and Desktop
21 Posts 8 Posters 11.2k 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.
  • L Offline
    L Offline
    laurent bauer
    wrote on last edited by
    #12

    What do you mean with "memory management things" ? The shared classes ?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Panke
      wrote on last edited by
      #13

      [quote author="laurent bauer" date="1293645469"]

      • Implicit sharing and associated objects with reference counting
        [/quote]

      yes

      1 Reply Last reply
      0
      • L Offline
        L Offline
        laurent bauer
        wrote on last edited by
        #14

        In the first post, i wrote: "You create an orphan widget, you attach it later to a parent widget. The parent takes ownership and you don’t need to worry anymore about the child life cycle"

        I like this idea : you transfer the management of an object to an object owner. And you don't have to manage it yourself .

        Do you know if this is a concept, a design pattern or anything which has a name?
        Do you know if this coding way is described somewhere?

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

          The parent - child relationship, that includes lifetime coupling?

          I would say it's a normal Komposition (UML :-) ).

          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
          • L Offline
            L Offline
            laurent bauer
            wrote on last edited by
            #16

            So simple? Well, I feel a bit ridiculous...

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

              Must everything be complicated?

              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
              • I Offline
                I Offline
                ivan
                wrote on last edited by
                #18

                In a sense, it is just an extension to the standard C++ behaviour to work with pointers (free on destruction) so it is not really a new concept.

                Ivan Čukić | ivan.cukic(at)kde.org | KDE e.V.
                Qt Ambassador (from the old Nokia days)

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  laurent bauer
                  wrote on last edited by
                  #19

                  OK, I guess a widget has a container of children widgets which are destroyed by the parent destructor.
                  However, it must be a little bit more tricky because the ownership can be transfered to another parent widget.

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #20

                    It's only a QObjectList (which is just a typedef for QList<QObject *>). It is only little more than removing from one and inserting into the other list (and handling layout issues in case of widgets).

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      CreMindES
                      wrote on last edited by
                      #21

                      Yes, it's that simple :) The best things are so simple :)

                      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