如何在视觉对象中创建 UI C++
How to create UI in C++ visual
我是C++和Visual Studio的新手,任何人都可以帮助我创建满足以下要求的UI吗?
要求:有一个包含 10 个测试用例的.txt文件。在UI中,我(测试人员)应该能够选择他/她选择的测试用例来运行。
尝试使用 MFC
项目。您可以在 GUI 工具箱中找到下拉菜单。在MFC
中进一步学习。
参考这个 - https://www.youtube.com/watch?v=6hSYZdvQ3s4&index=1&list=WL
请考虑使用命令行界面的可能性,如以下模板所示:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
// check that parameter is given in command line when program is run
if(argc != 2) // if number of parameters is insufficient
{ // explaine and stop
cout << "Please, run a program with parameter: name of file with testcases" << endl;
cout << "For example:" << endl << " " << argv[0] << " tests.txt" << endl;
return 1;
}
// try to open file with test cases
ifstream testfile;
testfile.open(argv[1], ifstream::in);
if( !testfile.is_open() )
{
cout << "ERROR: File " << argv[1] << " cannot be open!" << endl;
return 2;
}
// read test cases from file
string testCaseName;
char answer;
while( getline(testfile, testCaseName).good() )
{
if(testfile.eof())
{
break;
}
if(testCaseName.length() == 0)
{
continue;
}
cout << "Would you like to execute testcase " << testCaseName << " ? (Y/N): ";
cin >> answer;
if( answer == 'Y' || answer == 'y')
{
cout << "Test execution... " << endl;
// run test case
// . . .
// report test results
// . . .
}
}
return 0;
}
要使用此类程序运行测试,您应该在命令行中键入:
programname test_file.txt
相关文章:
- 如何创建一个CMake变量,除非显式重写,否则使用默认值
- 可以在JSON文件的帮助下在Qt中创建UI表单
- 如何创建一个接口,允许我访问C++中的按钮(和其他ui)函数,该函数是使用python中的MFC实现的
- 如何创建第二个 QT .ui 表单
- 如何创建一组UI元素,您可以迭代
- 是否有可能让Qt Creators UI设计师为它无法识别的类创建插槽?
- 如何在视觉对象中创建 UI C++
- 在cpp中创建Maya UI窗口
- tr( ) 在按钮标题等中由 UI 编辑器创建的用法
- WinRT 在桌面应用中创建'Windows.UI.Popups.MessageDialog'失败
- 为Qt中现有的C++项目创建UI的某些部分
- 如何创建OpenMaya UI
- 从.cpp和.h为Qt Designer创建ui文件
- 如何调用创建.ui设计表单在Qt与button.clicked()事件
- 我如何在qt中创建多个窗体/ .ui
- qt4:覆盖UI编辑器创建的小部件的事件处理程序方法
- Qt Ui设计器-创建窗口默认框架和默认按钮
- 如何/应该在Qt中创建ui表单和数据成员之间的自动链接
- 在C++中创建基于HTML的Windows UI的工具
- c++和Qt,我如何在对象创建上运行构造函数或不同的函数来设置Ui