[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Need help using QWebPluginFactory
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2012-02-20 14:49:42
Message-ID: a21468dd600f7c5e33e7ab9f2cd42670 () localhost
[Download RAW message or body]
On Mon, 20 Feb 2012 15:37:36 +0100, Detlev Offenbach
<detlev@die-offenbachs.de> wrote:
> Hello,
>
> I am having a bit of trouble using QWebPluginFactory.Plugin. I want to
> attach
> a MimeType object to it's mimeTypes list, but the list stays empty (s.
> below).
> What am I doing wrong?
>
> Python 3.2.2 (default, Oct 23 2011, 17:46:58) [GCC] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from PyQt4.QtWebKit import QWebPluginFactory
>>>> p=QWebPluginFactory.Plugin()
>>>> p
> <PyQt4.QtWebKit.Plugin object at 0xa2bd00>
>>>> p.mimeTypes
> []
>>>> mt=QWebPluginFactory.MimeType
>>>> p.mimeTypes.append(mt)
>>>> p.mimeTypes
> []
>>>>
PyQt (actually SIP) only supports the binding of attributes so you have to
do something like...
mime_types = p.mimeTypes
mime_types.append(mt)
p.mimeTypes = mime_types
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic