草庐IT

testqstring

全部标签

c++ - 运行 Qt 单元测试

查看Qt'ssite,并在anotherStackoverflowanswer因为我不想为每个要测试的类创建一个单独的项目,所以我想出了以下代码:测试字符串.h#ifndefTESTQSTRING_H#defineTESTQSTRING_H#includeclassTestQString:publicQObject{Q_OBJECTprivateslots:voidtoUpper();};#endif//TESTQSTRING_H测试字符串.cpp#include"testqstring.h"#includevoidTestQString::toUpper(){QStringstr="