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. Weird signal and slot problem
Forum Updated to NodeBB v4.3 + New Features

Weird signal and slot problem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 606 Views 1 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.
  • yczoY Offline
    yczoY Offline
    yczo
    wrote on last edited by yczo
    #1

    hello, I'm trying to conect a signal from an object, to a signal on a thread, both QString. I make the conection on main window, that is my code (in mainwindow):

    
        gMsg = new getmsg(this,mWSize.x,mWSize.y);
        serPort = new sport(this);
        serPort->start();
    connect(gMsg,SIGNAL(rqstAll(QString)),serPort,SLOT(updateMsg(QString)),Qt::QueuedConnection);
    

    the compiler get the next error that i could not solved, deleting the temporary compile directory and right botton on project + clean

    I ask you please help on Monday, the boss will give me the talk of dismissal (), but I want the program end.

    Thanks in advance

    moc_sport.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl sport::updateMsg(class QString)" (?updateMsg@sport@@QEAAXVQString@@@Z) referenced in function "private: static void __cdecl sport::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@sport@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z)

    Joel BodenmannJ 1 Reply Last reply
    0
    • yczoY yczo

      hello, I'm trying to conect a signal from an object, to a signal on a thread, both QString. I make the conection on main window, that is my code (in mainwindow):

      
          gMsg = new getmsg(this,mWSize.x,mWSize.y);
          serPort = new sport(this);
          serPort->start();
      connect(gMsg,SIGNAL(rqstAll(QString)),serPort,SLOT(updateMsg(QString)),Qt::QueuedConnection);
      

      the compiler get the next error that i could not solved, deleting the temporary compile directory and right botton on project + clean

      I ask you please help on Monday, the boss will give me the talk of dismissal (), but I want the program end.

      Thanks in advance

      moc_sport.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl sport::updateMsg(class QString)" (?updateMsg@sport@@QEAAXVQString@@@Z) referenced in function "private: static void __cdecl sport::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@sport@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z)

      Joel BodenmannJ Offline
      Joel BodenmannJ Offline
      Joel Bodenmann
      wrote on last edited by
      #2

      I'm not 100% which one of these causes the error but:

      • Make sure that your sport class has the Q_OBJECT macro
      • If you added the Q_OBJECT macro after the first compile, you must manually re-run qmake by Build -> Run qmake
      • Make sure that your sport class actually has the updateMsg() method implemented
      • Make sure that your sport class actually lists the updateMsg() method in the public slots section

      I hope that helps.

      Industrial process automation software: https://simulton.com
      Embedded Graphics & GUI library: https://ugfx.io

      1 Reply Last reply
      1
      • yczoY Offline
        yczoY Offline
        yczo
        wrote on last edited by
        #3

        Thank you very much for your help.

        Finally was that i forget sport:: on

        void sport::updateMsg(QString newMsg){

        }

        1 Reply Last reply
        0

        • Login

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