[PyQt] QSVGWidget load method, python3

Matt Smith melkor at orangepalantir.org
Sun Mar 29 17:10:11 BST 2009


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)

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



More information about the PyQt mailing list