コード例 #1
0
ファイル: printhooks.py プロジェクト: jonathanverner/qidle
 def from_QImage(self, img):
     buf = QByteArray()
     bf = QBuffer(buf)
     bf.open(QIODevice.WriteOnly)
     img.save(bf, format='PNG')
     self.buf = buf.data()
     self.format = PackedQImage.FORMAT_PNG
     self._encode()
コード例 #2
0
ファイル: pylintgui.py プロジェクト: Brainsciences/luminoso
 def read_output(self, error=False):
     if error:
         self.process.setReadChannel(QProcess.StandardError)
     else:
         self.process.setReadChannel(QProcess.StandardOutput)
     bytes = QByteArray()
     while self.process.bytesAvailable():
         if error:
             bytes += self.process.readAllStandardError()
         else:
             bytes += self.process.readAllStandardOutput()
     text = unicode( QString.fromLocal8Bit(bytes.data()) )
     if error:
         self.error_output += text
     else:
         self.output += text
コード例 #3
0
 def read_output(self, error=False):
     if error:
         self.process.setReadChannel(QProcess.StandardError)
     else:
         self.process.setReadChannel(QProcess.StandardOutput)
     bytes = QByteArray()
     while self.process.bytesAvailable():
         if error:
             bytes += self.process.readAllStandardError()
         else:
             bytes += self.process.readAllStandardOutput()
     text = unicode(QString.fromLocal8Bit(bytes.data()))
     if error:
         self.error_output += text
     else:
         self.output += text
コード例 #4
0
 def getBytesFromData(data):
     b = QByteArray()
     data >> b
     return b.data()