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

qobject_cast failed if an object is created by a library and cast in another project.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.9.6
    • Core: Object Model
    • None
    • Windows

    Description

      I have built a solution with visual studio 2015. it's has server projects, one main project(we call A project) which generate a exe file, another one (we call B Library)is a dynamic library which is depend by A project.

      i have defined an base class C1 (inherit form QObject) in a header file.then in B library i inherit the base class(name it C2).

      the problem is if the object is created in B library, and A project get the object use the interface B explored, then use qobject_cast cast the object to C1 will return NULL. but succeed if use dynamic_cast.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            zhuzhen ZHU ZHEN
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes