PDA

View Full Version : Why doesn't PyQt4 support SWF files?



blanchoir
1st August 2011, 00:17
Such a powerful framework, yet a swf files are not supporting inside the QWebview? Or do i have it all wrong?

Isn't there GNASH for PyQt?

blanchoir
1st August 2011, 02:27
13 views and not a single reply. amazing.

Talei
1st August 2011, 08:26
SWF with QWebview works "fine", or at least should (it's rely on installed plug-ins in system).
I tested fancy browser (c++ no in PyQT but probably that doesn't make any diffrence) and on Win swf's played fine.
Although on Linux x64 it didn't played probably due to missing plug-ins or misconfiguration of view (I have adobe betas flash player and swf load fine but don't play).
Basically look int view settings and enable Plugins, i.e.:

view->settings()->globalSettings()->setAttribute( QWebSettings::PluginsEnabled, true );
view->settings()->globalSettings()->setAttribute( QWebSettings::JavaEnabled, true );
view->settings()->globalSettings()->setAttribute( QWebSettings::JavascriptEnabled, true );
view->settings()->globalSettings()->setAttribute( QWebSettings::AcceleratedCompositingEnabled, true );
view->settings()->globalSettings()->setAttribute( QWebSettings::SiteSpecificQuirksEnabled, true );

SixDegrees
1st August 2011, 08:42
13 views and not a single reply. amazing.

Why? Did you bother looking at any other post stats? If you had, you'd find that a 5% to 10% response rate relative to views is about average. In fact, that's true of pretty much every forum I've examined.

wysota
1st August 2011, 12:42
Especially considering the fact most of those 13 views are probably web spiders...

blanchoir
1st August 2011, 19:02
Found the answer, its exactly what you guys said. Thanks everyone, sorry for not being patient, I feel stupid.



I was actually looking for a Cover Flow widget and decided to get one in Flash and put it in a QWebView Widget.

wysota
1st August 2011, 19:14
Not very efficient approach since there is a nice pure Qt implementation of cover flow available.

http://code.google.com/p/pictureflow/

blanchoir
1st August 2011, 21:57
Not very efficient approach since there is a nice pure Qt implementation of cover flow available.

http://code.google.com/p/pictureflow/

I know that, but it doesn't work with PyQt, its supported in the next release 0.2

Theres no bindings for PyQt, you have to make your own. I tried qmake, make install, it says theres no pictureflow.sbf file found.



Can I use PictureFlow with Python?

The current stable version (0.1) does not offer Python support yet, expect this in the next version (0.2). Alternatively, you can use PyQt and SIP and generate the bindings by yourself. Please refer to PyQt and SIP documentations for details

It says you can use PyQt, but how would i do that? I don't understand how to generate the bindings myself.

wysota
1st August 2011, 23:11
As a last resort you can write a bit of C++ code that will expose a single C type function which will do what you want and I assume calling a C function from Python is quite easy. However getting proper bindings would surely be a better solution.

Have you played with SIP?
http://www.riverbankcomputing.co.uk/software/sip/intro

blanchoir
1st August 2011, 23:21
thank you Wysota, you have been more than helpful. I will look into it.