PyQT QWebView Local swf file not loading

sgperone simone.perone at gmail.com
Sun Jun 28 13:10:05 CEST 2009


On 28 Giu, 13:05, sgperone <simone.per... at gmail.com> wrote:
> 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


> 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




More information about the Python-list mailing list