Skip to content

PythonQt.QtCore.QIODevice · declarations 002

Back to PythonQt.QtCore.QIODevice

writeData

writeData(data: str, len: int) -> int

X.writeData(data, len) -> int

Supplemental documentation: Qt 5 reference:

[pure virtual protected] qint64 QIODevice::writeData(const char *data, qint64 maxSize)

Writes up to maxSize bytes from data to the device. Returns the number of bytes written, or -1 if an error occurred.

This function is called by QIODevice. Reimplement this function when creating a subclass of QIODevice.

When reimplementing this function it is important that this function writes all the data available before returning. This is required in order for QDataStream to be able to operate on the class. QDataStream assumes all the information was written and therefore does not retry writing if there was a problem.

See also read() and write().

Upstream PySide2 reference signatures (binding differences may apply):

writeData(self, data: str, len: int) -> int

Source: https://doc.qt.io/archives/qt-5.15/qiodevice.html#writeData