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

QMetaObject inherits does not work as documented

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.12.0
    • None
    • Qt 5.12.0
      MSVC2017 64bit

      Windows 10x64

      QtCreator 4.8.0
      Based on Qt 5.12.0 (MSVC 2015, 32 bit)
      Built on Dec 3 2018 13:08:01
      From revision d51ddbb8f0
    • Windows

      While QMetaObject::inherits works when passing QMetaObject::superClass, it does not work when passing a QObject::staticMetaObject of the base class. I've provided a very basic example below, and with just one level of inheritance it does not work.

        1. TestClass.h
          0.4 kB
        2. TestClass.cpp
          0.4 kB
        3. qml.qrc
          0.1 kB
        4. QMetaObjectTest.pro
          1 kB
        5. main.qml
          0.1 kB
        6. main.cpp
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ogoffart Olivier Goffart (Woboq GmbH)
            dchamberlain David Chamberlain
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes