在写程序时,遇到函数 void ReadImage(HObject* Image, const HTuple& FileName);
需要将QString类型转化为HTuple类型。
首先看一下HTuple数据类型定义:
// String (C style)
HTuple(const char *s);
所以需要将QString转化为const char *类型。
QString ImageFileName;
QByteArray ba = ImageFileName.toLatin1();
const char *str = ba.data();
cout << ImageFileName.toStdString() << endl << endl;
HTuple ImageName(str);
ReadImage(&inputImageFirst, ImageName);