五、HTML与Word
搜索"Qt操作Word",可以找到通过QAxObject和COM Object联合直接读写Word的方法。但是,这个方法用起来不是很方便,在次,我介绍一种另类的方法,就是将“html格式代码保存到QString”,然后将QString导出为“.doc文件”。类似于直接保存“.html文件”,不同的是文件后缀名。如下示例代码:
voidSaveReportThread::SaveToWord()
{
QStringReportPath = QDir::toNativeSeparators(QCoreApplication::applicationDirPath()); //