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. Getting problem in using textedit inside write in tcp qt ...!!!!
Forum Updated to NodeBB v4.3 + New Features

Getting problem in using textedit inside write in tcp qt ...!!!!

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 742 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.
  • E Offline
    E Offline
    ecmanja
    wrote on last edited by
    #1

    hello im doing a tcp program in qt i want to send content of textedit on client side to textedit on server side for this i used
    write(ui->textedit->settext("hello"));
    but this giving a error like this
    E:\Qt_files\cust_send\secdialog.cpp:23: error: invalid use of void expression
    sendsocket->write(ui->textEdit->setText("hello"));
    but if use lineedit instead of it ,everything works fine but my intention is to use textedit so can anyone solve this problem....??

    thanks

    1 Reply Last reply
    0
    • IamSumitI Offline
      IamSumitI Offline
      IamSumit
      wrote on last edited by
      #2

      Hello ecmanja,

      You are doing 2 tasks at the same time writing string on socket as well as setting text on textEdit .
      First of all set the text in textEdit after that take a QString variable that will hold the entire text of textEdit using QString toPlainText () const and then pass this variable to write() function.

      Hope it will work..

      Be Cute

      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