+void tst_QGlyphRun::boundingRect()
+{
+ QString s(QLatin1String("AbCdE"));
+
+ QRawFont rawFont(QRawFont::fromFont(QFont()));
+ QVERIFY(rawFont.isValid());
+ QVector<quint32> glyphIndexes = rawFont.glyphIndexesForString(s);
+ QVector<QPointF> positions = rawFont.advancesForGlyphIndexes(glyphIndexes);
+ QCOMPARE(glyphIndexes.size(), s.size());
+ QCOMPARE(positions.size(), glyphIndexes.size());
+
+ QGlyphRun glyphs;
+ glyphs.setRawFont(rawFont);
+ glyphs.setGlyphIndexes(glyphIndexes);
+ glyphs.setPositions(positions);
+
+ QRectF boundingRect = glyphs.boundingRect();
+
+ glyphs.clear();
+ glyphs.setRawFont(rawFont);
+ glyphs.setRawData(glyphIndexes.constData(), positions.constData(), glyphIndexes.size());
+ QCOMPARE(glyphs.boundingRect(), boundingRect);
+
+ boundingRect = QRectF(0, 0, 1, 1);
+ glyphs.setBoundingRect(boundingRect);
+ QCOMPARE(glyphs.boundingRect(), boundingRect);
+}
+