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

QMetaObject::newInstance is broken for Q_GADGET ( regression between 12.3 and 12.4 )

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.12.4
    • Core: Object Model
    • None
    • All

    Description

      With Qt 12.4 ( missing in 12.3 ) a bad check has been added to QMetaObject::newInstance:

      if ( !inherits(&QObject::staticMetaObject ))

      {     ...     return nullptr; }

      As calling QMetaObject::newInstance is totally fine for Q_GADGET classes, this check is not only wrong, but also introduces an incompatible regression between 12.3 and 12.4.

      Several of my project are unusable with all versions >= Qt 12.4 and I would prefer not having to change all my Q_GADGETs into Q_OBJECTs to get things running again.

      Please also remove this bad check from Qt 13.x.

      Attachments

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

        Activity

          People

            milianw Milian Wolff
            uwe Uwe Rathmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes