Thanks to one of LyX's best friends (can you guess who?), I have discovered that Qt already provides exactly the sort of XML library we need in the QXmlStreamReader and QXmlStreamWriter classes. These are part of QtCore, which is allowed in src/ and is already present there:

./lyx-20/src/ [⚡ 2.0.x] > grep '#include <Q' *.{h,cpp}
Compare.h:#include <QObject>
Compare.h:#include <QThread>
Compare.h:#include <QTimer>
Compare.h:#include <QWaitCondition>
Server.h:#include <QObject>
Server.h:#include <QEvent>
Server.cpp:#include <QCoreApplication>
Server.cpp:#include <QThread>

So it would obviously make sense to use these for reading and writing LyX files.

These classes were introduced in Qt 4.3. Some of the member functions were introduced later. But by 2.2, we will surely expecting a recent enough version, so I do not expect there is any sort of issue here. But I can try to make sure, as I write this stuff, to document what functions we are using.

The only significant worry here concerns stability: Could a Qt update break us? We already depend heavily on Qt, so this is not as large a concern as with depending upon other external libraries. And my sense is that these classes are likely to be pretty stable.

Richard

Reply via email to