Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QTextStream and unget (or ungetChar)
nicesw123 last edited by
is unget possible with QTextStream?
How does one go about peek'ing or unget'ing stuff?
Use-case: read either a string of a number from a steam.
How: read a character (is >> ws >> ch) and if it is a number (i.e. isdigit(ch) == true), unget it and read into an int (is >> number)
Rondog last edited by
Something like this might work (didn't try it)
text_pos = text_stream.pos();
// read char
// read number instead