I am developing GUI using QT and here is my Program framework: The main function is for the interactive interface and I create a thread in the mainwindow class. The thread is named mythread. In mythread.cpp, mythread class inherits Qthread for implementing some data caculating. The function for this new thread is for calculating and printing the result in the output box in QT. My question is : when I use "cout" to print the result, the result shows when the whole program finishes(not immediately after finishing calculating -during the whole program the thread calculates for more than a hundred times, more than a hundread results shows after the program ends- almost at the same time). But when I use "qdebug", I can get the correct output result(the calculating results shows separately).
I want to know the reason.