When using QTextObjectInterface and has a drawObject method overload like this:
void MyImageHandler::drawObject(QPainter *painter, const QRectF &rect,
QTextDocument *doc, int posInDocument,
const QTextFormat &format)
QBrush br(Qt::red, Qt::FDiagPattern);
the fill pattern is scaled wrongly when printing to higher resolutions.
In particular, the distance between the pattern lines is too small. The higher the resolution, the closer the lines. On 600 dpi printers the patterns appear solid.
I attached patched versions of textedit.cpp and textedit.h of your TextEdit demo application. If you replace the original file by these you should be able to see the issue when you perform print or a print preview.
I also attached screenshots from the patched demo app. One from the editor itself (looks fine), one from the print preview (looks weird) and one from an exported pdf (looks solid).
The exported pdf is also attached. Note: If you heavily zoom into the pdf the diagonal pattern lines re-appear.