Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76334

Disable autodeletion by parent for QObjects

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.12.3
    • Core: Object Model
    • None
    • All

    Description

      In modern C++, it is very common to use smart pointer for memory management and autodeletion by QObject parent prevents adoption of smart pointer.

      For instance, I have to make my class inherit QObject to use signal, and once I make my type as a derived type of OQbject, I cannot share my type using QSharedPointer or std::shared_ptr and I have to care accidental deletion by parent which is very annoying.

      Maybe memory management by parent-child relation was helpful for old times C++.
      However, I think it's an obstacle for modernizing C++ source code using Qt for now.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            xylosper Byoung-young Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes