Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, February 2007
Read to first white space


Message 1 in thread

Hi

I would like to know to read a word not the whole line with QTextStream. If 
there are examples as how to do this, I would appreciate it if some one can 
tell me where.


Thanks

--
 [ signature omitted ] 

Message 2 in thread

Ill be a bit of a PITA today.. but you may want to RTM...
QTextStream::operator>>(QString&) 
Does exactly what your looking for

From the docs:
QTextStream & QTextStream::operator>> ( QString & str )
This is an overloaded member function, provided for convenience.

Reads a word from the stream and stores it in str, then returns a
reference to the stream. Words are separated by whitespace (i.e., all
characters for which QChar::isSpace() returns true).

Leading whitespace is skipped.

Scott

> -----Original Message-----
> From: Chris [mailto:chris@xxxxxxxxxxxxxxx]
> Sent: Tuesday, February 20, 2007 1:37 AM
> To: Qt Interest List
> Subject: Read to first white space
> 
> Hi
> 
> I would like to know to read a word not the whole line with
QTextStream.
> If
> there are examples as how to do this, I would appreciate it if some
one
> can
> tell me where.
> 
> 
> Thanks
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ]