PDA

View Full Version : Cin and QT: Doesn't accept input from the user via the output screen



Sammyp
10th July 2018, 03:13
Hi there,

I am very new at QT and have some knowledge on C++. My university has given us a textbook which explains very little about how or where to enter the code or what to choose when inputting the examples. If I type the Code in normal c++ it works. When I type it in a QT Application project file, the CIN statement doesn't allow one to input anything and I have to manually crash the program. Please can someone explain what I am doing wrong.

I'd really appreciate it.

Kind regards

Sam

Uwe Yashwanth
10th July 2018, 04:58
Hey there.
You can use cin and cout in the main ie. the driver. Main.cpp.
Since, you are a beginner you probably treat Qt as a language.
Its not. Its just a framwork for GUI development. Basically, most of your input would come through elements like checkboxes,line edits, buttons etc.
What you intend to do should be clearly explained to clear your confusion.
Since you are still trying out examples. I suggest you leave out cin and cout for experimenting in the beginning.
Elaborate your question on a field for clearer understanding

https://wiki.qt.io/Qt_for_Beginners
Also this should help.