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 Update on Monday, May 27th 2025

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 192 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 1 Oct 2019, 16:32 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.

    A 1 Reply Last reply 1 Oct 2019, 17:39
    0
    • K KYADAV
      1 Oct 2019, 16:32

      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.

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 1 Oct 2019, 17:39 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

      1/2

      1 Oct 2019, 16:32

      • Login

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