PythonQt.QtCore.QTextStream · declarations 002
Back to PythonQt.QtCore.QTextStream
realNumberPrecision
realNumberPrecision() -> int
X.realNumberPrecision() -> int
Supplemental documentation: Qt 5 reference:
int QTextStream::realNumberPrecision() const
Returns the current real number precision, or the number of fraction digits QTextStream will write when generating real numbers.
See also setRealNumberPrecision(), setRealNumberNotation(), realNumberNotation(), numberFlags(), and integerBase().
Upstream PySide2 reference signatures (binding differences may apply):
realNumberPrecision(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#realNumberPrecision
reset
reset() -> None
X.reset()
Supplemental documentation: Qt 5 reference:
void QTextStream::reset()
Resets QTextStream's formatting options, bringing it back to its original constructed state. The device, string and any buffered data is left untouched.
Upstream PySide2 reference signatures (binding differences may apply):
reset(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#reset
resetStatus
resetStatus() -> None
X.resetStatus()
Supplemental documentation: Qt 5 reference:
void QTextStream::resetStatus()
Resets the status of the text stream.
This function was introduced in Qt 4.1.
See also QTextStream::Status, status(), and setStatus().
Upstream PySide2 reference signatures (binding differences may apply):
resetStatus(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#resetStatus
seek
seek(pos: int) -> bool
X.seek(pos) -> bool
Supplemental documentation: Qt 5 reference:
bool QTextStream::seek(qint64 pos)
Seeks to the position pos in the device. Returns true on success; otherwise returns
false.
Upstream PySide2 reference signatures (binding differences may apply):
seek(self, pos: int) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#seek
setAutoDetectUnicode
setAutoDetectUnicode(enabled: bool) -> None
X.setAutoDetectUnicode(enabled)
Supplemental documentation: Qt 5 reference:
void QTextStream::setAutoDetectUnicode(bool enabled)
If enabled is true, QTextStream will attempt to detect Unicode encoding by peeking into the stream data to see if it can find the UTF-8, UTF-16, or UTF-32 Byte Order Mark (BOM). If this mark is found, QTextStream will replace the current codec with the UTF codec.
This function can be used together with setCodec(). It is common to set the codec to UTF-8, and then enable UTF-16 detection.
See also autoDetectUnicode(), setCodec(), and QTextCodec::codecForUtfText().
Upstream PySide2 reference signatures (binding differences may apply):
setAutoDetectUnicode(self, enabled: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setAutoDetectUnicode
setCodec
setCodec(codec: Any) -> None
X.setCodec(codec)
Supplemental documentation: Qt 5 reference:
void QTextStream::setCodec(QTextCodec *codec)
Sets the codec for this stream to codec. The codec is used for decoding any data that is read from the assigned device, and for encoding any data that is written. By default, QTextCodec::codecForLocale() is used, and automatic unicode detection is enabled.
If QTextStream operates on a string, this function does nothing.
Warning: If you call this function while the text stream is reading from an open sequential socket, the internal buffer may still contain text decoded using the old codec.
See also codec(), setAutoDetectUnicode(), and setLocale().
void QTextStream::setCodec(const char *codecName)
Sets the codec for this stream to the
QTextCodec for the encoding
specified by codecName. Common values for codecName include "ISO 8859-1", "UTF-8",
and "UTF-16". If the encoding isn't recognized, nothing happens.
Example:
QTextStream out(&file);
out.setCodec("UTF-8");
See also QTextCodec::codecForName() and setLocale().
Upstream PySide2 reference signatures (binding differences may apply):
setCodec(self, codec: PySide2.QtCore.QTextCodec) -> None
setCodec(self, codecName: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setCodec
setDevice
setDevice(device: Any) -> None
X.setDevice(device)
Supplemental documentation: Qt 5 reference:
void QTextStream::setDevice(QIODevice *device)
Sets the current device to device. If a device has already been assigned, QTextStream will call flush() before the old device is replaced.
Note: This function resets locale to the default locale ('C') and codec to the default codec, QTextCodec::codecForLocale().
See also device() and setString().
Upstream PySide2 reference signatures (binding differences may apply):
setDevice(self, device: PySide2.QtCore.QIODevice) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setDevice
setFieldAlignment
setFieldAlignment(alignment: Any) -> None
X.setFieldAlignment(alignment)
Supplemental documentation: Qt 5 reference:
void QTextStream::setFieldAlignment(QTextStream::FieldAlignment mode)
Sets the field alignment to mode. When used together with setFieldWidth(), this function allows you to generate formatted output with text aligned to the left, to the right or center aligned.
See also fieldAlignment() and setFieldWidth().
Upstream PySide2 reference signatures (binding differences may apply):
setFieldAlignment(self, alignment: PySide2.QtCore.QTextStream.FieldAlignment) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setFieldAlignment
setFieldWidth
setFieldWidth(width: int) -> None
X.setFieldWidth(width)
Supplemental documentation: Qt 5 reference:
void QTextStream::setFieldWidth(int width)
Sets the current field width to width. If width is 0 (the default), the field width is equal to the length of the generated text.
Note: The field width applies to every element appended to this stream after this function has been called (e.g., it also pads endl). This behavior is different from similar classes in the STL, where the field width only applies to the next element.
See also fieldWidth() and setPadChar().
Upstream PySide2 reference signatures (binding differences may apply):
setFieldWidth(self, width: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setFieldWidth
setGenerateByteOrderMark
setGenerateByteOrderMark(generate: bool) -> None
X.setGenerateByteOrderMark(generate)
Supplemental documentation: Qt 5 reference:
void QTextStream::setGenerateByteOrderMark(bool generate)
If generate is true and a UTF codec is used, QTextStream will insert the BOM (Byte Order Mark) before any data has been written to the device. If generate is false, no BOM will be inserted. This function must be called before any data is written. Otherwise, it does nothing.
See also generateByteOrderMark() and bom().
Upstream PySide2 reference signatures (binding differences may apply):
setGenerateByteOrderMark(self, generate: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setGenerateByteOrderMark
setIntegerBase
setIntegerBase(base: int) -> None
X.setIntegerBase(base)
Supplemental documentation: Qt 5 reference:
void QTextStream::setIntegerBase(int base)
Sets the base of integers to base, both for reading and for generating numbers. base can be either 2 (binary), 8 (octal), 10 (decimal) or 16 (hexadecimal). If base is 0, QTextStream will attempt to detect the base by inspecting the data on the stream. When generating numbers, QTextStream assumes base is 10 unless the base has been set explicitly.
See also integerBase(), QString::number(), and setNumberFlags().
Upstream PySide2 reference signatures (binding differences may apply):
setIntegerBase(self, base: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setIntegerBase
setLocale
setLocale(locale: Any) -> None
X.setLocale(locale)
Supplemental documentation: Qt 5 reference:
void QTextStream::setLocale(const QLocale \&locale)
Sets the locale for this stream to locale. The specified locale is used for conversions between numbers and their string representations.
The default locale is C and it is a special case - the thousands group separator is not used for backward compatibility reasons.
This function was introduced in Qt 4.5.
See also locale().
Upstream PySide2 reference signatures (binding differences may apply):
setLocale(self, locale: PySide2.QtCore.QLocale) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setLocale
setNumberFlags
setNumberFlags(arg0: flags) -> None
X.setNumberFlags(flags)
Supplemental documentation: Qt 5 reference:
void QTextStream::setNumberFlags(QTextStream::NumberFlags flags)
Sets the current number flags to flags. flags is a set of flags from the NumberFlag enum, and describes options for formatting generated code (e.g., whether or not to always write the base or sign of a number).
See also numberFlags(), setIntegerBase(), and setRealNumberNotation().
Upstream PySide2 reference signatures (binding differences may apply):
setNumberFlags(self, flags: PySide2.QtCore.QTextStream.NumberFlags) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setNumberFlags
setPadChar
setPadChar(ch: str) -> None
X.setPadChar(ch)
Supplemental documentation: Qt 5 reference:
void QTextStream::setPadChar(QChar ch)
Sets the pad character to ch. The default value is the ASCII space character (' '), or QChar(0x20). This character is used to fill in the space in fields when generating text.
Example:
QString s;
QTextStream out(&s);
out.setFieldWidth(10);
out.setFieldAlignment(QTextStream::AlignCenter);
out.setPadChar('-');
out << "Qt" << "rocks!";
The string s contains:
----Qt------rocks!--
See also padChar() and setFieldWidth().
Upstream PySide2 reference signatures (binding differences may apply):
setPadChar(self, ch: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setPadChar
setRealNumberNotation
setRealNumberNotation(notation: Any) -> None
X.setRealNumberNotation(notation)
Supplemental documentation: Qt 5 reference:
void QTextStream::setRealNumberNotation(QTextStream::RealNumberNotation notation)
Sets the real number notation to notation (SmartNotation, FixedNotation, ScientificNotation). When reading and generating numbers, QTextStream uses this value to detect the formatting of real numbers.
See also realNumberNotation(), setRealNumberPrecision(), setNumberFlags(), and setIntegerBase().
Upstream PySide2 reference signatures (binding differences may apply):
setRealNumberNotation(self, notation: PySide2.QtCore.QTextStream.RealNumberNotation) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setRealNumberNotation
setRealNumberPrecision
setRealNumberPrecision(precision: int) -> None
X.setRealNumberPrecision(precision)
Supplemental documentation: Qt 5 reference:
void QTextStream::setRealNumberPrecision(int precision)
Sets the precision of real numbers to precision. This value describes the number of fraction digits QTextStream should write when generating real numbers.
The precision cannot be a negative value. The default value is 6.
See also realNumberPrecision() and setRealNumberNotation().
Upstream PySide2 reference signatures (binding differences may apply):
setRealNumberPrecision(self, precision: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setRealNumberPrecision
setStatus
setStatus(status: Any) -> None
X.setStatus(status)
Supplemental documentation: Qt 5 reference:
void QTextStream::setStatus(QTextStream::Status status)
Sets the status of the text stream to the status given.
Subsequent calls to setStatus() are ignored until resetStatus() is called.
This function was introduced in Qt 4.1.
See also Status, status(), and resetStatus().
Upstream PySide2 reference signatures (binding differences may apply):
setStatus(self, status: PySide2.QtCore.QTextStream.Status) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#setStatus
skipWhiteSpace
skipWhiteSpace() -> None
X.skipWhiteSpace()
Supplemental documentation: Qt 5 reference:
void QTextStream::skipWhiteSpace()
Reads and discards whitespace from the stream until either a non-space character is detected, or until atEnd() returns true. This function is useful when reading a stream character by character.
Whitespace characters are all characters for which
QChar::isSpace() returns
true.
See also operator>>().
Upstream PySide2 reference signatures (binding differences may apply):
skipWhiteSpace(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#skipWhiteSpace
status
status() -> Any
X.status()
Supplemental documentation: Qt 5 reference:
QTextStream::Status QTextStream::status() const
Returns the status of the text stream.
See also QTextStream::Status, setStatus(), and resetStatus().
Upstream PySide2 reference signatures (binding differences may apply):
status(self) -> PySide2.QtCore.QTextStream.Status
Source: https://doc.qt.io/archives/qt-5.15/qtextstream.html#status
writeByte
writeByte(ch: Any) -> Any
X.writeByte(ch) -> PythonQt.QtCore.QTextStream
writeDouble
writeDouble(f: Any) -> Any
X.writeDouble(f) -> PythonQt.QtCore.QTextStream
writeFloat
writeFloat(f: Any) -> Any
X.writeFloat(f) -> PythonQt.QtCore.QTextStream
writeInt
writeInt(i: Any) -> Any
X.writeInt(i) -> PythonQt.QtCore.QTextStream
writeLongLong
writeLongLong(i: Any) -> Any
X.writeLongLong(i) -> PythonQt.QtCore.QTextStream
writeShort
writeShort(i: Any) -> Any
X.writeShort(i) -> PythonQt.QtCore.QTextStream