16,173
社区成员
发帖
与我相关
我的任务
分享
QAxObject * range = worksheet->querySubObject("Cells(int,int)", i+1, 1); //得到单元格
if (!range)
{
qDebug()<<"range does not exist";
}
QVariant tel=QString("%1").arg(record["tel"].toString()); //02883120983,0开头的电话号码
//qDebug()<<tel;
range->setProperty("Value", tel.toString());
range->dynamicCall("SetNumberFormatLocal(const QVariant&)", QVariant("@"));
//qDebug()<<"NumberFormatLocal:"<<range->property("NumberFormatLocal").toString(); //输出"@"
//qDebug()<<"NumberFormat:"<<range->property("NumberFormat").toString();//输出"@"
range->clear();
range = worksheet->querySubObject("Cells(int,int)", i+1, 2); //另外一个cell
//range->dynamicCall("SetValue(const QVariant&)", record["location"]);
range->setProperty("Value", record["location"]);
range->clear();