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. Created QTcpSocket object in main() and calling write function of socket in another QThread
Forum Updated to NodeBB v4.3 + New Features

Created QTcpSocket object in main() and calling write function of socket in another QThread

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 210 Views
  • 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.
  • K Offline
    K Offline
    KYADAV
    wrote on last edited by
    #1

    Created QTcpSocket object in main() , on receiving data I am connecting to a slot which is part of another QThread (used movetoThread function) . I am able to invoke function But tcpsocket is not calling write function . It seems tcpsocket object is not exist inside Qthread slot.

    aha_1980A 1 Reply Last reply
    0
    • K KYADAV

      Created QTcpSocket object in main() , on receiving data I am connecting to a slot which is part of another QThread (used movetoThread function) . I am able to invoke function But tcpsocket is not calling write function . It seems tcpsocket object is not exist inside Qthread slot.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @KYADAV

      QTcSocket is asynchronous. In 99% of cases you are better using it without a thread.

      Regarding your problem: can you show your code?

      Regards

      Qt has to stay free or it will die.

      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