Windows에서 Qt Creator를 사용하는 매우 간단한 콘솔 앱을 실행하고 있습니다.Windows에서 Qt Creator를 사용하는 콘솔 앱 : 콘솔을 닫기 전에 대기
실행하면 dos 콘솔이 열리고 출력은 표시되지만 응용 프로그램이 종료되고 콘솔이 즉시 닫힙니다.
사용자가 키를 누를 때까지 콘솔이 열려있는 상태를 유지하려면 어떻게해야합니까? Windows Vista에서 Qt는 창조주 1.2.1 테스트
#include <QTextStream>
#include <QFile>
//#include <conio.h> // for getch()
int main(int argc, char *argv[])
{
// JC and friends code
// Qt Solution
QTextStream Qin(stdin);
forever
{
QString Line = Qin.readLine();
if (!Line.isNull())
{
break;
}
}
// conio solution
//getch();
return 0;
}
두 솔루션 :
Qt Creator에 설정이 존재하기를 바랍니다. 어쨌든 Thx! –