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

When operating qtobject with QML, there is a probability of generating serious bug

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.13.2, 5.14.1
    • Core: Object Model
    • None
    • Windows
    • All

    Description

      I have a QT project. In C + +, I derive a QObject class, construct an object and register it correctly in the QML environment. QML operates the properties and methods of this QObject many times, but there is a certain chance that it will be inexplicable to deconstruct this object. I debugged the object's destructor function, and found an event (and possibly a signal) to deconstruct this object. I promise to replace it The code is completely correct, and there is no destructor call of delete and destroy in QT and QML. A solution is found inadvertently, that is, assign a value to the parent of that object (as long as it is not nullptr), and the program is completely OK.

      Both of my projects have encountered this problem, which I think is not a coincidence.

      Attachments

        1. 注释.url
          0.1 kB
        2. Desktop.rar
          27 kB
        3. 9.png
          9.png
          61 kB
        4. 8.png
          8.png
          47 kB
        5. 7.png
          7.png
          59 kB
        6. 6.png
          6.png
          50 kB
        7. 5.png
          5.png
          43 kB
        8. 4.png
          4.png
          57 kB
        9. 3.png
          3.png
          59 kB
        10. 2.png
          2.png
          58 kB
        11. 11.png
          11.png
          51 kB
        12. 1.png
          1.png
          54 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            pleafles 孤鹰 深林
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes