PDA

View Full Version : Qt+QWebKit+Java+Flash not working



progDes
30th April 2009, 10:31
Hi all.
I need to display Flash animation in my Qt application, and ability to control it programmaticaly. The only decision I found is - use QWebKit and control Flash through Java. I have sample html file that is parialy works on IE, Opera and Google Chroome(which is built on top of WebKit as I know). But when I'm loading this webpage in my Qt application - I see working flash animation. But non of scripts are working well.

Here is script example:


function getFlashMovieObject(movieName)
{
return document.getElementById(movieName);
}

function PlayFlashMovie()
{
var flashMovie=getFlashMovieObject("myFlashMovie");
if (flashMovie == null) alert("bad");
else alert("good");
//everything is ok until here
flashMovie.Play();
//never see this message
alert("I'm here");
}

The same situation with another scripts. In places where I try to access Flash object - java script is silently terminates.

I posted this thread on this forum - because in browsers something seems to work (at least Platy/Pause ZoomIn/ZoomOut), but from Qt application nothing is working.

Here is code from app:

SlideViewWidget::SlideViewWidget(QWidget * parent) : QWebView(parent)
{

page()->settings()->setAttribute(QWebSettings::JavascriptEnabled,true) ;
page()->settings()->setAttribute(QWebSettings::PluginsEnabled,true);
page()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindow s,true);

loadFilm(QString("file://localhost/") + Resources::resourcePrefix + "test.swf");

}
SlideViewWidget::~SlideViewWidget()
{
}
void SlideViewWidget::loadFilm(const QString & fname)
{
QString html = Resources::flashPlayerBaseHtml;
setHtml(html);

}

Realy need help. Thanks.

e8johan
30th April 2009, 11:38
I've had similar problems with the client side database. I suggest that you register an issue in Qt Software's tasktracker - http://www.qtsoftware.com/developer/task-tracker .

progDes
30th April 2009, 17:49
I know that it would be a wonder, but may be there are another crossplatform ways to embed and control Flash window in Qt application?