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. cout and cin redirect in qtextEdit
Forum Updated to NodeBB v4.3 + New Features

cout and cin redirect in qtextEdit

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

    i have this code
    #include <iostream>

    int main() {
    char a[20];
    std::cin>>a;
    std::cout << a;

    return 0;
    

    } 
    i want take input and out from textedit box

    jsulmJ 1 Reply Last reply
    0
    • V VIKASKUMAR

      i have this code
      #include <iostream>

      int main() {
      char a[20];
      std::cin>>a;
      std::cout << a;

      return 0;
      

      } 
      i want take input and out from textedit box

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @VIKASKUMAR Can you explain why you want to put input from std::cin into a QTextEdit. You should describe your use case better.
      Putting text into QTextEdit is simple: https://doc.qt.io/qt-6/qtextedit.html#append or https://doc.qt.io/qt-6/qtextedit.html#setText

      And please don't double post! Your other post is same, right? https://forum.qt.io/topic/142990/input-and-output-are-displayed-in-the-terminals-by-my-c-code-they-should-be-shown-in-qt-textedit-please?_=1676529236213

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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