Hi, i want to save a QPixmap object as File.png...
Qt Code:
  1. format=QtCore.QString("png") #to QString.
  2. intitialPath=QtCore.QDir.currentPath()+"/snapshot"+str(self.counter)+"."+format
  3.  
  4. fileName=QtGui.QFileDialog.getSaveFileName(self, "Save As", intitialPath, "PNG Files (*.png);;All Files (*.*)" )
  5. if not fileName.isEmpty():
  6. self.originalPixamp.save(fileName, format.toAscii())
  7. self.counter += 1
To copy to clipboard, switch view to plain text mode 
self.counter is just for formatting the snapshot name.

Error:
self.originalPixamp.save(fileName, QtCore.QString(format.toAscii()))
TypeError: argument 2 of QPixmap.save() has an invalid type
However, in C++ i used it the same way and it works ?!

I'm using PyQt4
Thanks in advance.