dhaumann added a comment.
Well, this change only affects the SyntaxHighlighter, which KTextEditor does not use ;) For completeness: https://code.woboq.org/qt5/qtbase/src/gui/text/qtextdocument.cpp.html#673 Here, we can see that QTextDocument::drawContents() internally uses a QAbstractTextDocumentLayout::PaintContext ctx, which itself provides a default-constructed QPalette. A defaut-constructed QPalette equals the application palette. So the only other way for the text thumbnailer is to temporarily set the QApplication palette. REPOSITORY R216 Syntax Highlighting REVISION DETAIL https://phabricator.kde.org/D21295 To: dhaumann, vkrause, cullmann, kossebau Cc: kwrite-devel, kde-frameworks-devel, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann