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. Signal and slot in different threads

Signal and slot in different threads

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 554 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.
  • V Offline
    V Offline
    vaishnavi.s
    wrote on last edited by
    #1

    Hi,

    I have object A which has signal and slot. I need to execute IOCTL to device asynchronously. I use QConcurrent:: run for this. After the ioctl is completed, i emit a signal. The connection of signal and slot is with default connection type. But the slot is never invoked. The slot is invoked only if i specify direct connection.
    @
    connect(this, SIGNAL(signal_xyz(int)), this SLOT(slot_xyz(int));
    QConcurrent:run(this,&Class_Name::function_name, param1,param2);
    @
    The threadpool::globalinstance->setmaxthread is set to 10.

    i saw a similar post which tells to use qMetaObject::invokemethod. But even with that, the slot is called only if connection is directconnection.

    In my case, the fist IOCTL will take sometime, the 2nd IOCTL finishes before 1st completes. In this case, the slot is always called in the order of execution rather than the order of reply from the device.

    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