Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Connect signal to signal
Forum Updated to NodeBB v4.3 + New Features

Connect signal to signal

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 5 Posters 19.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mandruk1331M Offline
    mandruk1331M Offline
    mandruk1331
    wrote on last edited by mandruk1331
    #1

    As the title says I want to connect signal to a signal but the compiler gives me this error:

    error: no matching function for call to '_Camera::connect(MarkFrame*&, const char*, _Camera*, const char*)'
          QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
    
    _Camera::_Camera(QString camera_name){
         this->camera_name = camera_name;
         markFrame = new MarkFrame;
         connect(&socket,SIGNAL(bytesWritten(qint64)),this,SLOT(bytesWrittenC(qint64)));
         QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
     }
    

    What could be the problem?

    Mandruk1331

    A Venkatesh VV J.HilkJ 3 Replies Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Is
      Log(QString)
      placed in the signal section ?
      Also clean build folder and re-run qmake and then rebuild all just to be sure.

      1 Reply Last reply
      3
      • mandruk1331M mandruk1331

        As the title says I want to connect signal to a signal but the compiler gives me this error:

        error: no matching function for call to '_Camera::connect(MarkFrame*&, const char*, _Camera*, const char*)'
              QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
        
        _Camera::_Camera(QString camera_name){
             this->camera_name = camera_name;
             markFrame = new MarkFrame;
             connect(&socket,SIGNAL(bytesWritten(qint64)),this,SLOT(bytesWrittenC(qint64)));
             QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
         }
        

        What could be the problem?

        A Offline
        A Offline
        ambershark
        wrote on last edited by
        #3

        @mandruk1331 To add to @mrjj is MarkFrame derived from QOjbect and contains the Q_OBJECT macro?

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        1 Reply Last reply
        3
        • mandruk1331M mandruk1331

          As the title says I want to connect signal to a signal but the compiler gives me this error:

          error: no matching function for call to '_Camera::connect(MarkFrame*&, const char*, _Camera*, const char*)'
                QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
          
          _Camera::_Camera(QString camera_name){
               this->camera_name = camera_name;
               markFrame = new MarkFrame;
               connect(&socket,SIGNAL(bytesWritten(qint64)),this,SLOT(bytesWrittenC(qint64)));
               QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
           }
          

          What could be the problem?

          Venkatesh VV Offline
          Venkatesh VV Offline
          Venkatesh V
          wrote on last edited by
          #4

          @mandruk1331

          First you make sure that both the source and destination objects are derived from QObject and as @ambershark said, add Q_OBJECT macro and in connect statement QObject:: is not required because you are already in QObject context only.
          If you go through all the above cases, it should works.

          1 Reply Last reply
          1
          • mandruk1331M mandruk1331

            As the title says I want to connect signal to a signal but the compiler gives me this error:

            error: no matching function for call to '_Camera::connect(MarkFrame*&, const char*, _Camera*, const char*)'
                  QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
            
            _Camera::_Camera(QString camera_name){
                 this->camera_name = camera_name;
                 markFrame = new MarkFrame;
                 connect(&socket,SIGNAL(bytesWritten(qint64)),this,SLOT(bytesWrittenC(qint64)));
                 QObject::connect(markFrame,SIGNAL(logM(QString)),this,SIGNAL(Log(QString)));
             }
            

            What could be the problem?

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @mandruk1331 Iirc the old syntax does not support signal to signal connections, you should use the new one, that way it works for sure.

            connect(markFrame,&MarkFrame::logM ,this,&_Camera::Log);
            

            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            mrjjM 1 Reply Last reply
            1
            • J.HilkJ J.Hilk

              @mandruk1331 Iirc the old syntax does not support signal to signal connections, you should use the new one, that way it works for sure.

              connect(markFrame,&MarkFrame::logM ,this,&_Camera::Log);
              
              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @J.Hilk
              old syntax does do signal to signal or i really have a vivid imagination as i use
              signal to signal to interface to widgets from dialogs. :)

              J.HilkJ 1 Reply Last reply
              2
              • mrjjM mrjj

                @J.Hilk
                old syntax does do signal to signal or i really have a vivid imagination as i use
                signal to signal to interface to widgets from dialogs. :)

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @mrjj I just reread the docs and turns out my memory is treasonous thing these last few days...


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                mrjjM 1 Reply Last reply
                1
                • J.HilkJ J.Hilk

                  @mrjj I just reread the docs and turns out my memory is treasonous thing these last few days...

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by mrjj
                  #8

                  @J.Hilk
                  Its due to summer. Brain thinks on other types on 'connections' ;)
                  alt text

                  1 Reply Last reply
                  2

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved