Results 1 to 2 of 2

Thread: Send shared_ptr using signal

  1. #1
    Join Date
    Sep 2015
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Send shared_ptr using signal

    I have a thread which makes a huge object
    and I want to pass it using qt signal back to main thread.

    Can I pass the shared_ptr (c++11) reffering to that object,
    and how?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Send shared_ptr using signal

    You need to declare the specialized shared pointer type with Q_DECLARE_METATYPE and call qRegisterMetaType() somewhen before using the signal.

    http://doc.qt.io/qt-5/qmetatype.html#Q_DECLARE_METATYPE

    Cheers,
    _

Similar Threads

  1. send signal from 1 gui to another gui
    By tho97 in forum Qt Programming
    Replies: 3
    Last Post: 5th December 2007, 21:21
  2. Can you send a signal to a thread?
    By Dumbledore in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2007, 20:31
  3. QAction signal: want to send int
    By vonCZ in forum Newbie
    Replies: 10
    Last Post: 2nd July 2007, 18:52
  4. Manually send signal to slot
    By donmorr in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2006, 15:03
  5. send signal from QCombobox
    By raphaelf in forum Qt Programming
    Replies: 22
    Last Post: 28th February 2006, 14:18

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.