Results 1 to 5 of 5

Thread: Signal not found / thread communication

  1. #1
    Join Date
    Nov 2010
    Location
    Hong Kong / Germany
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Signal not found / thread communication

    Dear All,
    I'm new to the forum nice to be here !

    My nasty problem I fight with:
    (thread 1 main) - (thread 2 worker)
    worker read an external device and send QByteArray back to the main-thread.
    Therefore I create a signal in the worker and slot in the main with a connect(&thread,..).

    I test the signal/slot within the worker-thread to see if the emit works // yes fine
    but the main thread give me a

    Object::connect: No such signal worker::listItemUpdate(const QByteArray ba) in reader.cpp:25

    any hint is highly appreciated.

    Chris

    Qt Code:
    1. class worker : public QThread
    2. ...
    3. signals:
    4. void listItemUpdate(const QByteArray& ba);
    5.  
    6.  
    7. class main : public QMainWindow
    8. ...
    9. private slots:
    10. void RlistItemUpdate(const QByteArray ba);
    11. ...
    12. private:
    13. worker InvThread;
    14.  
    15. main::main()
    16. ...
    17. connect(&InvThread, SIGNAL(listItemUpdate(const QByteArray ba))
    18. , this , SLOT(RlistItemUpdate(const QByteArray ba)));
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Signal not found / thread communication

    Qt Code:
    1. connect(&InvThread, SIGNAL(listItemUpdate(const QByteArray))
    2. , this , SLOT(RlistItemUpdate(const QByteArray)));
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Sep 2010
    Posts
    145
    Thanks
    1
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signal not found / thread communication

    You're calling connect() with named parameters. This simply isn't right.

  4. #4
    Join Date
    Nov 2010
    Location
    Hong Kong / Germany
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Signal not found / thread communication

    Thank guy's
    It was a bit late last night!
    you have the answer already here:

    http://www.qtcentre.org/faq.php?faq=...alslot_nodebug

    Cheers
    Chris
    I'm using Debian-Linux QT4.6.3 and QT4.7

  5. #5
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Signal not found / thread communication

    Are you sure you don't want to sent a const reference instead of a const bytearray?

Similar Threads

  1. Replies: 4
    Last Post: 7th March 2010, 16:58
  2. Replies: 9
    Last Post: 28th November 2009, 20:31
  3. Thread Communication not doing so well
    By BatteryCell in forum Qt Programming
    Replies: 7
    Last Post: 19th June 2007, 01:08
  4. Main thread - worker thread communication.
    By kikapu in forum Newbie
    Replies: 25
    Last Post: 23rd May 2007, 22:09
  5. QThread communication without signal and slots
    By forrestfsu in forum Qt Programming
    Replies: 16
    Last Post: 22nd May 2007, 00:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.