def _new_buffer(self, raw_data): buff = QBuffer() buff.setData(raw_data) buff.open(QIODevice.ReadOnly) return buff