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

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes