@TheTrueGoofy said in Read and write QBrush (QPen, QFont) as XML:

Certainly this is also quite simple to implement, but I was hoping that there is a more elegant solution.

I think the only other way is to create feature request for QtGui, or implement a Qt patch yourself - to add a QBrush::toString() method (or QTextStream overload), with a corresponding QBrush::fromString().