windows 7运行qt终端
Running qt terminal for windows 7
我的程序(下面)可以编译,但它不允许我输入值。我看过很多线程,它们表示从运行中单击终端框,但这只会弹出一个窗口,说明"按下关闭此窗口",这确实违背了目的。在这方面有任何帮助就太好了。由于
#include <QCoreApplication>
#include <QTextStream>
//using namespace std;
QTextStream cin(stdin);
QTextStream cout(stdout);
int main()
{
QString firstName;
QString lastName;
QString houseNumber;
QString streetName;
QString streetType;
QString city;
QString state;
QString zipCode;
QString phone;
cout<<"Please enter your first name: " << endl;
cin >> firstName;
cout << endl <<"Please enter your first name: " << endl;
cin >> lastName;
cout << endl <<"Please enter your house number: " << endl;
cin >> houseNumber;
cout << endl <<"Please enter your street Name: " << endl;
cin >> streetName;
cout << endl <<"Please enter your street type (i.e. Rd, St, Blvd, ect): ";
cin >> streetType;
cout << endl <<"Please enter your city: " << endl;
cin >> city;
cout << endl <<"Please enter your state: " << endl;
cin >> state;
cout << endl <<"Please enter your zip code: " << endl;
cin >> zipCode;
cout << endl <<"Please enter your phone number: " << endl;
cin >> phone;
cout << endl << "Your information is: " << endl << endl;
cout << firstName <<" "<<lastName<<endl;
cout << houseNumber << " " << streetName << " " << streetType << endl;
cout << city << ", " << state << " " << zipCode << endl;
cout << "Phone Number: " << phone << endl << endl;
return 0;
}
如果您需要在终端上运行程序,这里已经解决了:使用Qt Creator进行控制台输入
至少对我有用。
相关文章:
- 如何从 bash 脚本捕获终端输出并将其显示在我的 Qt UI 中?
- 从QT C 控制Ubuntu终端
- 在Qt小部件应用程序中显示cmd终端
- 打开终端时出错:MacOs 10.12.4 上的 Qt Creator 未知
- 如何隐藏QT应用中打开的Windows终端
- 如何在不将其连接到终端的情况下运行'screen',以便我可以在C++ (qt) 应用程序中捕获输出?
- Qt 和 Raspberry Pi 获取终端命令的响应值
- 使用 QT 创建器通过树莓派上的 Wifi 执行简单的终端命令
- QT 上的 exe 文件在树莓派终端上的更新时间时挂起
- Qt:调用终端+脚本的QProcess
- 通过QT运行终端
- 如何在Qt应用程序中通过终端命令运行分离的应用程序
- 终端模拟器作为Qt小部件
- 通过终端和编译创建项目文件失败,但通过Qt Creator IDE工作正常
- 串行通信不通过QSerialPort (Qt)工作,但通过终端(白蚁)工作
- 如何在MacOS X Sierra上安装Qt并在终端上添加qmake
- linux mint终端不执行Qt creator给出的命令
- Qt应用程序是否需要终端用户提供额外的库?比如c#和.net框架
- Qt串行通信终端
- windows 7运行qt终端