From 1f5a051bee201fd69c499138fc3d919d1e38aa4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 15 May 2019 21:29:34 +0200 Subject: [PATCH] Fixed broken text display in Qt < 5.4 (Qt bug workaround) --- src/map/IMG/textpointitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/map/IMG/textpointitem.cpp b/src/map/IMG/textpointitem.cpp index 39be2239..89e014f5 100644 --- a/src/map/IMG/textpointitem.cpp +++ b/src/map/IMG/textpointitem.cpp @@ -66,8 +66,14 @@ void TextPointItem::paint(QPainter *painter) const painter->setPen(*_color); painter->drawText(_textRect, FLAGS, *_text); } else { +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) img.invertPixels(); painter->drawImage(_textRect, img); +#else // QT >= 5.4 + QImage iimg(img.convertToFormat(QImage::Format_ARGB32)); + iimg.invertPixels(); + painter->drawImage(_textRect, iimg); +#endif // QT >= 5.4 } }