PDA

View Full Version : Help: Play Flash media in Qt GUI application



RogerShen
5th March 2010, 07:45
hey all,
I want to play flash (.swf) files,and I realize it in Windows as follows:

#include <QtGui>
#include <QAxWidget>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QAxWidget *flash = new QAxWidget(0,0);
flash->resize(1000,700);
flash->setControl(QString::fromUtf8("{d27cdb6e-ae6d-11cf-96b8-444553540000}"));
flash->dynamicCall("LoadMovie(long,string)",0,"G:/e.swf");
flash->show();

return a.exec();
}

and add CONFIG+=qaxcontainer in .PRO
But QAxWidget is not included in other operation system like (linux or Mac) it seems that ActiveX only support Win.
So, I wanna ask how to play .swf in Qt Gui application in other os, like Mac or Linux?
thx~

wysota
5th March 2010, 11:59
Probably the easiest way would be to use WebKit - display a QWebView containing html with a flash object and WebKit's flash plugin will do the rest.