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. connecttohost TcpSocket parameters from Textfield

connecttohost TcpSocket parameters from Textfield

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 775 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.
  • P Offline
    P Offline
    Prasad_Socionext
    wrote on last edited by VRonin
    #1
    void Tcpip_Client::tcpConnect(const QString server_name, QString server_port)
    {
    
        tcpSocket->abort();
    
        tcpSocket->connectToHost(server_name,server_port);
    

    When I write the address instead of getting it from a text field it works. but when i try to get it from textfield it does not. do i need some data conversion here ?

    aha_1980A 1 Reply Last reply
    0
    • P Prasad_Socionext
      void Tcpip_Client::tcpConnect(const QString server_name, QString server_port)
      {
      
          tcpSocket->abort();
      
          tcpSocket->connectToHost(server_name,server_port);
      

      When I write the address instead of getting it from a text field it works. but when i try to get it from textfield it does not. do i need some data conversion here ?

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

      Hi @Prasad_Socionext,

      Your code snippet looks odd. The second parameter of connectToHost is quint16, not QString.

      Regards

      Qt has to stay free or it will die.

      P 1 Reply Last reply
      3
      • aha_1980A aha_1980

        Hi @Prasad_Socionext,

        Your code snippet looks odd. The second parameter of connectToHost is quint16, not QString.

        Regards

        P Offline
        P Offline
        Prasad_Socionext
        wrote on last edited by
        #3

        @aha_1980 Thanks I found it out

        Pablo J. RoginaP 1 Reply Last reply
        1
        • P Prasad_Socionext

          @aha_1980 Thanks I found it out

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @Prasad_Socionext if you issue is solved, please don't forget to mark your post as such. Thanks.

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          P 1 Reply Last reply
          1
          • Pablo J. RoginaP Pablo J. Rogina

            @Prasad_Socionext if you issue is solved, please don't forget to mark your post as such. Thanks.

            P Offline
            P Offline
            Prasad_Socionext
            wrote on last edited by
            #5

            @Pablo-J.-Rogina how to mark it ?

            mrjjM 1 Reply Last reply
            0
            • P Prasad_Socionext

              @Pablo-J.-Rogina how to mark it ?

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Prasad_Socionext
              On your first post, in "Topic tools" there is menu item.

              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