Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71036 Qt Core Changes in Qt 6
  3. QTBUG-79401

qvariant: Avoid dangling QObject pointers

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Unresolved
    • P2: Important
    • 6.0
    • Core: Object Model
    • None
    • All

    Description

      When storing a QObject pointer or a QObject-subclass pointer in a QVariant, the raw pointer is stored in QVariant's QObject *Data::o member. Numerous times in the past this has caused crashes in user code when the pointer became dangling.

      We should consider making QVariant safe by defaulting to supporting a weak reference.

      Unfortunately, this cannot be done in Qt 5 without breaking binary compatibility.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              shausman Simon Hausmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes