Skip to content
Snippets Groups Projects
Commit 5f086cd9 authored by Mayeul Cantan's avatar Mayeul Cantan
Browse files

Simplify PainterHighQualityEnabler code

There is no need to iterate over a list, flags can be applied and stored
simultaneously.
parent 6219604f
No related branches found
No related tags found
No related merge requests found
......@@ -139,18 +139,10 @@ public:
PainterHighQualityEnabler(Painter &p)
: _painter(p)
{
static constexpr QPainter::RenderHint Hints[] = {QPainter::Antialiasing,
QPainter::SmoothPixmapTransform,
QPainter::TextAntialiasing};
auto hints = _painter.renderHints();
for (const auto &hint : Hints) {
if (!(hints & hint))
hints_ |= hint;
}
hints_ = QPainter::Antialiasing | QPainter::SmoothPixmapTransform |
QPainter::TextAntialiasing;
if (hints_)
_painter.setRenderHints(hints_);
_painter.setRenderHints(hints_);
}
~PainterHighQualityEnabler()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment