准备一个.swf格式的文件放在工程的debug文件夹下比如:m.swf
05 | int main( int argc, char *argv[]) |
09 | QApplication a(argc, argv); |
11 | QTextCodec::setCodecForLocale(QTextCodec::codecForName( "gb18030" )); |
13 | QTextCodec::setCodecForCStrings(QTextCodec::codecForName( "gb18030" )); |
15 | QTextCodec::setCodecForTr(QTextCodec::codecForName( "gb18030" )); |
17 | QAxWidget *flash = new QAxWidget(0,0); |
19 | flash->resize(1000,700); |
21 | flash->setControl(QString::fromUtf8( "{d27cdb6e-ae6d-11cf-96b8-444553540000}" )); |
23 | QString name=qApp->applicationDirPath(); |
25 | flash->dynamicCall( "LoadMovie(long,string)" ,0,qApp->applicationDirPath()+ "/m.swf" ); |
在.prc中加入CONFIG+=qaxcontainer
本人转自@王广的博客,非常感谢~