Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Problem with std::cin and getting input from console generally
Forum Update on Monday, May 27th 2025

Problem with std::cin and getting input from console generally

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 223 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.
  • R Offline
    R Offline
    rzerobzerot
    wrote on 13 Jan 2025, 18:53 last edited by
    #1

    I'm new to QT so I tried creating Qt application on console that accepts input from user using std::cin but when I run it, It's either it got stuck in this phase or it skipped it, I've tried qinfo qin too, same issues. What could be the problem?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 13 Jan 2025, 18:58 last edited by
      #2

      Hi and welcome to devnet,

      What exactly did you try ?
      Remember Qt is an async framework so just putting std::cin won't work like that.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • R Offline
        R Offline
        rzerobzerot
        wrote on 13 Jan 2025, 21:48 last edited by
        #3

        image.png

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 14 Jan 2025, 20:02 last edited by
          #4

          Check the comments of David Faure on this stack overflow answer.

          Check QSocketNotifier and QWinEventNotifier.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          13 Jan 2025, 18:53

          • Login

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