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

Moc compiler changes slot signature

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.5.4, 6.7.3
    • Build tools: moc
    • None

    Description

      class TestClass : public QObject{    
        Q_OBJECT
      public slots:    
        void testFunction(std::function<void(const QByteArray &)> successCallback) 
        {}
      }; 

      Given the code above the moc file contains a different function signature than the one provided as a slot.

      case 0: _t->testFunction((*reinterpret_cast< std::add_pointer_t<std::function<const void(QByteArray&)>>>(_a[1]))); break; 

      Seems like the `const` qualifier has relocated.

      Removing `slots` from the access modifiers resolves the compilation issue.

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            hancerliqt Burak Hancerli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes