QT展示PDF文件
CONFIG += qaxcontainer
#include <QAxWidget>
QAxWidget* officeContent = new QAxWidget(this);;
QString filename = "1.pdf";
officeContent= new QAxWidget("Microsoft Web Browser");
QVariant v = officeContent->dynamicCall("Navigate(const QString&)", filename);QString filename = "1.pdf"; QDesktopServices::openUrl(QUrl::fromLocalFile(filename ));

登录后可发表评论
点击登录