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

moc: When doing MyClass* const& as a signal/slot parameter then the code generated is invalid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.7.0
    • 4.5.0
    • Core: Object Model
    • None
    • b881d8fb99972f1bd04ab4c84843cc8d43ddbeed

      When doing MyClass* const& as a signal/slot parameter then the 'const&' part is not stripped from the generated code as it would in case of 'MyClass const&' parameter.

      MOC strips a reference to constant in the following expression:

      void mySlot( MyClass const& );
      becomes: "mySlot(MyClass)\0"

      while not in the following expression:
      void mySlot( MyClass* const& );
      becomes: "mySlot(MyClass*const&)\0"

      hence in the 2nd scenario, a
      connect( mySender, SIGNAL( mySig( MyClass* ) ), myReceiver, SLOT(mySlot( MyClass* ) ) )
      will not be possible since the parameter list doesn't match.

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

            bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes