我想写一些电话号码excel文件,其中一些从0开始(如02167820096)。 我尝试在列的NumberFormatLocal属性设置为字符串类型:如何通过Qt设置excel列格式?
QAxObject* col=worksheet->querySubObject("Columns(int)",1);
if (!col)
{
qDebug()<
}
qDebug()<property("NumberFormatLocal").toString();
col->setProperty("NumberFormatLocal","@");
qDebug()<property("NumberFormatLocal").toString();
输出是
col 1 NumberFormatLocal: "G/通用格式"
col 1 NumberFormatLocal: "@"
,我可以看到在第一列的单元格确实被设置为字符串类型(“@ “)。
QAxObject * range = worksheet->querySubObject("Cells(int,int)", 1, 1);
if (!range)
{
qDebug()<
}
QVariant tel=QString("%1").arg(record["tel"].toString()); //tel is 02167820096
//qDebug()<
//r
最后
以上就是迷路招牌最近收集整理的关于qt怎么可以随意设置自己想要的表格_如何通过Qt设置excel列格式?的全部内容,更多相关qt怎么可以随意设置自己想要内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复