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

String-based QObject::connect asserts when parameters are incomplete types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P0: Blocker
    • 6.5.0 Beta1
    • 6.5
    • Core: Object Model
    • None
    • 7deb49d886 (qt/qtbase/dev)

    Description

      Ran into this when running Qt Location examples against dev after the recent meta object changes. The following example asserts as well when making the connection:

      #include <QObject>
      
      class Sender : public QObject
      {
          Q_OBJECT
      
      signals:
          void contentsChanged(const QImage &);
      };
      
      class Receiver : public QObject
      {
          Q_OBJECT
      
      public slots:
          void updateContents(const QImage &img) { }
      };
      
      int main(int argc, char *argv[])
      {
          Sender sender;
          Receiver receiver;
      
          QObject::connect(&sender, SIGNAL(contentsChanged(QImage)),
                           &receiver, SLOT(updateContents(QImage)));
      }
      
      #include "main.moc"
      

      The assert is

      ASSERT: "typeInfo & IsUnresolvedType || typeInfo == QMetaType::Void" in file /Users/vohi/qt/dev/qtbase/src/corelib/kernel/qmetaobject.cpp, line 1825
      

      The problem is fixed by including QImage, or by explicitly calling qRegisterMetaType<QImage>("QImage") before making the connection.

      Attachments

        For Gerrit Dashboard: QTBUG-105832
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes