summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter/tst_qpainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qpainter/tst_qpainter.cpp')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index ff9bf1c..83ff9a9 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -256,6 +256,7 @@ private slots:
void drawPointScaled();
void QTBUG14614_gradientCacheRaceCondition();
+ void drawTextOpacity();
private:
void fillData();
@@ -4576,6 +4577,30 @@ void tst_QPainter::QTBUG14614_gradientCacheRaceCondition()
producers[i].wait();
}
+void tst_QPainter::drawTextOpacity()
+{
+ QImage image(32, 32, QImage::Format_RGB32);
+ image.fill(0xffffffff);
+
+ QPainter p(&image);
+ p.setPen(QColor("#6F6F6F"));
+ p.setOpacity(0.5);
+ p.drawText(5, 30, QLatin1String("Qt"));
+ p.end();
+
+ QImage copy = image;
+ image.fill(0xffffffff);
+
+ p.begin(&image);
+ p.setPen(QColor("#6F6F6F"));
+ p.drawLine(-10, -10, -1, -1);
+ p.setOpacity(0.5);
+ p.drawText(5, 30, QLatin1String("Qt"));
+ p.end();
+
+ QCOMPARE(image, copy);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"