PyQT QWebView Local swf file not loading

S

sgperone

Just downloaded the pyQT 4.5 for python 2.6 and noticed this strange
behaviour:

inside a widget i have this code:

self.view = QWebView(self)
self.view.settings().setAttribute(QWebSettings.PluginsEnabled,True)

that's i'm creating a QWebView instance with PluginsEnabled flag on.

next lines are:

Case 1
===================================================
f = QtCore.QUrl("http://www.example.com/myflashfile.swf")
print f
self.view.load(f)

in this case f == True and the swf file is showing correctly inside
the widget

Case 2
===================================================
f = QtCore.QUrl.fromLocalFile(r"C:\myflashfile.swf")
print f
self.view.load(f)

in this case f == False and no swf clip showed up.

Really weird... if I use a local html file with code to embed the
local swf file everything is working.

So, it seems that:

It is impossible to load a local swf file directly into QWebView
without a "wrapper" html code.

Anyone experienced the same issue ?

Thanks
 
S

sgperone

Just downloaded the pyQT 4.5 for python 2.6 and noticed this strange
behaviour:

inside a widget i have this code:

self.view = QWebView(self)
self.view.settings().setAttribute(QWebSettings.PluginsEnabled,True)

that's i'm creating a QWebView instance with PluginsEnabled flag on.

next lines are:

Case 1
===================================================
f = QtCore.QUrl("http://www.example.com/myflashfile.swf")
print f
self.view.load(f)

in this case f == True and the swf file is showing correctly inside
the widget

Case 2
===================================================
f = QtCore.QUrl.fromLocalFile(r"C:\myflashfile.swf")
print f
Correction:
===================================================

it's not "f" that is True or False, but :

inside code i have:

self.connect(self.view,QtCore.SIGNAL("loadFinished
(bool)"),self.loadFinished)

and

def loadFinished(self,bool):
print bool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top