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. How to get QT creator to take input from the keyboard
Forum Updated to NodeBB v4.3 + New Features

How to get QT creator to take input from the keyboard

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 872 Views 2 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.
  • S Offline
    S Offline
    StudentGuy2544
    wrote on last edited by
    #1

    I started a new console application project and wrote a simple program to receive and then display a number and it works flawlessly on Xcode when i run it there. But on QT creator, it always skips "cin >>" and outputs my "cout <<" statements. I tried getting it to "Run in terminal" but when i do that, and press run, it only shows the time when i pressed run and it says "Starting projectname"

    By the way, I included #include <QTextStream> and #include <QDebug>

    JonBJ S 2 Replies Last reply
    0
    • mzimmersM Offline
      mzimmersM Offline
      mzimmers
      wrote on last edited by
      #2

      Can you post some relevant code? Also, have you tried running the app outside of Creator?

      1 Reply Last reply
      0
      • S StudentGuy2544

        I started a new console application project and wrote a simple program to receive and then display a number and it works flawlessly on Xcode when i run it there. But on QT creator, it always skips "cin >>" and outputs my "cout <<" statements. I tried getting it to "Run in terminal" but when i do that, and press run, it only shows the time when i pressed run and it says "Starting projectname"

        By the way, I included #include <QTextStream> and #include <QDebug>

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @StudentGuy2544
        Hello and welcome.

        When running inside Qt Creator, the "Output/Console window pane" is indeed only for showing you output from your application. It does not accept input.

        You do indeed need to have the "Run in terminal" option enabled to get a terminal window for a console application where you can provide input as well as see output. It should be working, but you say not. I am not a Mac user, but I believe I may have seen recent posts stating this does not work under Mac Creator in certain versions? You might try searching the forum posts. Otherwise I think you should state your Mac version and your Qt Creator version, someone else may know.

        1 Reply Last reply
        1
        • S StudentGuy2544

          I started a new console application project and wrote a simple program to receive and then display a number and it works flawlessly on Xcode when i run it there. But on QT creator, it always skips "cin >>" and outputs my "cout <<" statements. I tried getting it to "Run in terminal" but when i do that, and press run, it only shows the time when i pressed run and it says "Starting projectname"

          By the way, I included #include <QTextStream> and #include <QDebug>

          S Offline
          S Offline
          SimonSchroeder
          wrote on last edited by
          #4

          @StudentGuy2544 Are you using an M1 Mac?

          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