[PyQt] QSVGWidget load method, python3

Phil Thompson phil at riverbankcomputing.com
Wed Apr 1 15:14:09 BST 2009


On Sun, 29 Mar 2009 12:10:11 -0400, Matt Smith <melkor at orangepalantir.org>
wrote:
> Okay I was playing around with python 3 and I found that the SVGWidget
> gives me a 'file not found error' when I use either the method
> 
>   #new data is a QString svg file
> 
>   serialized_data = newdata.toLocal8Bit()
>   self.load(serialized_data)
> 
> or if I use a connect statement,
> 
>   self.connect(self,
>      QtCore.SIGNAL("ready( const QByteArray&)"),self.load)
> 
>   self.emit(QtCore.SIGNAL("ready( const QByteArray&)"),serialized_data)
> 
> It appears that both ways are using the 
> QSVGWidget.load(self,QString filename) 
> 
> method instead of the
> 
> QSvgWidget.load(self,QByteArray contents)

Fixed in current snapshots.

> using:
>  Qt 4.5.0
>  PyQt, Sip snapshots 20090324
>  python3.1a1
> 
> On a side note, maybe this is just the documentation not being up todate
> with python version three, QByteArray.fromRawData(str) was only working
> if I used a byte array, ie QByteArray.fromRawData(str.encode(my_string))
> 
> thanks
> mbs

Phil


More information about the PyQt mailing list