[Interest] Subclassing QIODevice and passing it to QXMLStreamReader

Wiebe Cazemier wiebe at halfgaar.net
Sat May 24 20:27:40 CEST 2014


----- Original Message -----
> From: "Wiebe Cazemier" <wiebe at halfgaar.net>
> To: interest at qt-project.org
> Sent: Saturday, 24 May, 2014 8:08:02 PM
> Subject: [Interest] Subclassing QIODevice and passing it to QXMLStreamReader
> 
> I'm trying to use a subclassed QIODevice for parsing XML with
> QXMLStreamreader, but no matter what I do, the data is not read.
> 
> The docs say:
> 
> > Subclasses of QIODevice are only required to implement
> > the protected readData() and writeData() functions.
> 
> But no matter what I do, the code in my ReadData function is not executed. I
> also tried overriding basically all virtual functions, but none of them get
> called.
> 
> I wrote some test code using QTextStream with my custom QIODevice, which
> works perfectly.
> 
> I use QXMLStreamReader::readNext() to read through the buffer, so how does it
> read from the QIODevice?
> 
> Regards,
> 
> Wiebe

Haha, never mind. I forgot to open it :)





More information about the Interest mailing list