Qt-interest Archive, August 2007
how does QTextStream work with QIODevice?
Message 1 in thread
Hello.
I want QTextStream to work with my class which inherits QIODevice.
So, what happens when we call:
QString read ( qint64 maxlen )
QString readAll ()
QString readLine ( qint64 maxlen = 0 )
?
I guess it simply calls the same methods of QIODevice class. Am I right?
Thanks in advace.
--
[ signature omitted ]
Message 2 in thread
On 05.08.07 01:38:19, Alex V. Fansky wrote:
> Hello.
> I want QTextStream to work with my class which inherits QIODevice.
> So, what happens when we call:
>
> QString read ( qint64 maxlen )
> QString readAll ()
> QString readLine ( qint64 maxlen = 0 )
> ?
>
> I guess it simply calls the same methods of QIODevice class. Am I right?
Not quite, it does a conversion from QByteArray to QString along the
way. Anything else you can see by looking at the source.
If you properly implement the QIODevice API your own class should work
with QTextStream.
Andreas
--
[ signature omitted ]