Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QQmlEninge is becoming null

QQmlEninge is becoming null

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 463 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.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by dheerendra
    #1

    Very peculiar case. QQmlEngine is becoming null. This is happening when the delegate objects are getting created inside the ListView scrolling. After this application crashes.

    Anyone has seen this kind of issue ?

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

    1 Reply Last reply
    1
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      What does becoming null mean?

      Asking a question about code? http://eel.is/iso-c++/testcase/

      dheerendraD 1 Reply Last reply
      0
      • jeremy_kJ jeremy_k

        What does becoming null mean?

        dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        @jeremy_k
        Thanks you. engine variable is 0x0. After that it crashes.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        jeremy_kJ 1 Reply Last reply
        1
        • dheerendraD dheerendra

          @jeremy_k
          Thanks you. engine variable is 0x0. After that it crashes.

          jeremy_kJ Offline
          jeremy_kJ Offline
          jeremy_k
          wrote on last edited by
          #4

          @dheerendra said in QQmlEninge is becoming null:

          @jeremy_k
          Thanks you. engine variable is 0x0. After that it crashes.

          How is this pointer initialized? Is this the value returned from qmlEngine(QObject *), QQmlComponent::engine(), or something else? Is it a QPointer or QWeakPointer?

          Asking a question about code? http://eel.is/iso-c++/testcase/

          dheerendraD 1 Reply Last reply
          0
          • jeremy_kJ jeremy_k

            @dheerendra said in QQmlEninge is becoming null:

            @jeremy_k
            Thanks you. engine variable is 0x0. After that it crashes.

            How is this pointer initialized? Is this the value returned from qmlEngine(QObject *), QQmlComponent::engine(), or something else? Is it a QPointer or QWeakPointer?

            dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by dheerendra
            #5

            @jeremy_k

            Thank you.
            When I analyze the code further found that
            class - qqmlconnections.cpp-
            method - void QQmlConnections::connectSignalsToMethods()
            Line#300
            QV4::ExecutionEngine *engine = ddata>context>engine->handle();

            So here data->context->engine object is becoming 0x0. I think this QPointer.
            This happens when the delegate objects are created when the ListView is scrolled up/down.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            jeremy_kJ 1 Reply Last reply
            0
            • dheerendraD dheerendra

              @jeremy_k

              Thank you.
              When I analyze the code further found that
              class - qqmlconnections.cpp-
              method - void QQmlConnections::connectSignalsToMethods()
              Line#300
              QV4::ExecutionEngine *engine = ddata>context>engine->handle();

              So here data->context->engine object is becoming 0x0. I think this QPointer.
              This happens when the delegate objects are created when the ListView is scrolled up/down.

              jeremy_kJ Offline
              jeremy_kJ Offline
              jeremy_k
              wrote on last edited by
              #6

              @dheerendra said in QQmlEninge is becoming null:

              @jeremy_k

              Thank you.
              When I analyze the code further found that
              class - qqmlconnections.cpp-
              method - void QQmlConnections::connectSignalsToMethods()
              Line#300
              QV4::ExecutionEngine *engine = ddata>context>engine->handle();

              So here data->context->engine object is becoming 0x0. I think this QPointer.
              This happens when the delegate objects are created when the ListView is scrolled up/down.

              At a glance I don't see a smart pointer involved.

              Have you tried connecting to QObject::destroyed() for the engine? That has helped me track several unexpected QObject deletions.

              Asking a question about code? http://eel.is/iso-c++/testcase/

              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