diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-11 17:23:34 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-11 17:23:34 (GMT) |
commit | 806d49e49be10ca7a478b1f0afc4fd0c98321480 (patch) | |
tree | f7e2dd74463c0e2de5f853c2687311d9071f0b47 /tests | |
parent | c21312c60231b3958981c72e6a190cba381b5720 (diff) | |
parent | c5846314dfd80e7f7f32ba737f1884dcccbbd80d (diff) | |
download | Qt-806d49e49be10ca7a478b1f0afc4fd0c98321480.zip Qt-806d49e49be10ca7a478b1f0afc4fd0c98321480.tar.gz Qt-806d49e49be10ca7a478b1f0afc4fd0c98321480.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team:
Fix QGLWidget::renderPixmap for raster engine on Mac
Check if OES_texture_npot is present on OpenGL ES 2.
Fix tst_QVariant::invalidColor
Move QTextCursor::MoveStyle to Qt namespace
Move the painting redirection to the unified toolbar surface.
Fix misspelled word in comment.
Build fix for tst_qrawfont
Add some QRawFont related low level functions to avoid extra copying
Compile on Mac
Rename QGlyphs -> QGlyphRun
Fix QRawFont::setPixelSize() on Mac
Remove warning from QColor::setNamedColor().
Add internal documentation for QUnifiedToolbarSurface.
Fix QPainter::drawGlyphs() with non-affine transformation
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui.pro | 2 | ||||
-rw-r--r-- | tests/auto/qcolor/tst_qcolor.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qcomplextext/tst_qcomplextext.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qglyphrun/qglyphrun.pro (renamed from tests/auto/qglyphs/qglyphs.pro) | 4 | ||||
-rw-r--r-- | tests/auto/qglyphrun/test.ttf (renamed from tests/auto/qglyphs/test.ttf) | bin | 3712 -> 3712 bytes | |||
-rw-r--r-- | tests/auto/qglyphrun/tst_qglyphrun.cpp (renamed from tests/auto/qglyphs/tst_qglyphs.cpp) | 154 | ||||
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qrawfont/tst_qrawfont.cpp | 52 | ||||
-rw-r--r-- | tests/auto/qtextedit/tst_qtextedit.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qvariant/tst_qvariant.cpp | 1 |
10 files changed, 129 insertions, 96 deletions
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index 22c5e51..42c8fb4 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -58,7 +58,7 @@ SUBDIRS=\ qfontdialog \ qfontmetrics \ qformlayout \ - qglyphs \ + qglyphrun \ qgraphicsanchorlayout \ qgraphicsanchorlayout1 \ qgraphicseffect \ diff --git a/tests/auto/qcolor/tst_qcolor.cpp b/tests/auto/qcolor/tst_qcolor.cpp index d42c26c..b02537e 100644 --- a/tests/auto/qcolor/tst_qcolor.cpp +++ b/tests/auto/qcolor/tst_qcolor.cpp @@ -1506,7 +1506,6 @@ void tst_QColor::setallowX11ColorNames() for (int i = 0; i < x11RgbTblSize; ++i) { QString colorName = QLatin1String(x11RgbTbl[i].name); QColor color; - QTest::ignoreMessage(QtWarningMsg, QString("QColor::setNamedColor: Unknown color name '%1'").arg(colorName).toLatin1()); color.setNamedColor(colorName); QVERIFY(!color.isValid()); } @@ -1528,7 +1527,6 @@ void tst_QColor::setallowX11ColorNames() for (int i = 0; i < x11RgbTblSize; ++i) { QString colorName = QLatin1String(x11RgbTbl[i].name); QColor color; - QTest::ignoreMessage(QtWarningMsg, QString("QColor::setNamedColor: Unknown color name '%1'").arg(colorName).toLatin1()); color.setNamedColor(colorName); QVERIFY(!color.isValid()); } diff --git a/tests/auto/qcomplextext/tst_qcomplextext.cpp b/tests/auto/qcomplextext/tst_qcomplextext.cpp index 58b31b4..ae63bac 100644 --- a/tests/auto/qcomplextext/tst_qcomplextext.cpp +++ b/tests/auto/qcomplextext/tst_qcomplextext.cpp @@ -214,7 +214,7 @@ void tst_QComplexText::bidiCursorMovement() QTextOption option = layout.textOption(); option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); layout.setTextOption(option); - layout.setCursorMoveStyle(QTextCursor::Visual); + layout.setCursorMoveStyle(Qt::VisualMoveStyle); bool moved; int oldPos, newPos = 0; qreal x, newX; diff --git a/tests/auto/qglyphs/qglyphs.pro b/tests/auto/qglyphrun/qglyphrun.pro index 5084cf9..480ad5b 100644 --- a/tests/auto/qglyphs/qglyphs.pro +++ b/tests/auto/qglyphrun/qglyphrun.pro @@ -2,10 +2,10 @@ load(qttest_p4) QT = core gui SOURCES += \ - tst_qglyphs.cpp + tst_qglyphrun.cpp wince*|symbian*: { DEFINES += SRCDIR=\\\"\\\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" -}
\ No newline at end of file +} diff --git a/tests/auto/qglyphs/test.ttf b/tests/auto/qglyphrun/test.ttf Binary files differindex 9043a57..9043a57 100644 --- a/tests/auto/qglyphs/test.ttf +++ b/tests/auto/qglyphrun/test.ttf diff --git a/tests/auto/qglyphs/tst_qglyphs.cpp b/tests/auto/qglyphrun/tst_qglyphrun.cpp index ffa0d00..aefc228 100644 --- a/tests/auto/qglyphs/tst_qglyphs.cpp +++ b/tests/auto/qglyphrun/tst_qglyphrun.cpp @@ -41,14 +41,14 @@ #include <QtTest/QtTest> -#include <qglyphs.h> +#include <qglyphrun.h> #include <qpainter.h> #include <qtextlayout.h> #include <qfontdatabase.h> // #define DEBUG_SAVE_IMAGE -class tst_QGlyphs: public QObject +class tst_QGlyphRun: public QObject { Q_OBJECT @@ -82,9 +82,9 @@ private: #if !defined(QT_NO_RAWFONT) -Q_DECLARE_METATYPE(QGlyphs); +Q_DECLARE_METATYPE(QGlyphRun); -void tst_QGlyphs::initTestCase() +void tst_QGlyphRun::initTestCase() { m_testFontId = QFontDatabase::addApplicationFont(SRCDIR "test.ttf"); QVERIFY(m_testFontId >= 0); @@ -94,19 +94,19 @@ void tst_QGlyphs::initTestCase() QCOMPARE(QFontInfo(m_testFont).family(), QString::fromLatin1("QtsSpecialTestFont")); } -void tst_QGlyphs::cleanupTestCase() +void tst_QGlyphRun::cleanupTestCase() { QFontDatabase::removeApplicationFont(m_testFontId); } -void tst_QGlyphs::constructionAndDestruction() +void tst_QGlyphRun::constructionAndDestruction() { - QGlyphs glyphIndexes; + QGlyphRun glyphIndexes; } -static QGlyphs make_dummy_indexes() +static QGlyphRun make_dummy_indexes() { - QGlyphs glyphs; + QGlyphRun glyphs; QVector<quint32> glyphIndexes; QVector<QPointF> positions; @@ -121,16 +121,16 @@ static QGlyphs make_dummy_indexes() positions.append(QPointF(3, 4)); positions.append(QPointF(5, 6)); - glyphs.setFont(QRawFont::fromFont(font)); + glyphs.setRawFont(QRawFont::fromFont(font)); glyphs.setGlyphIndexes(glyphIndexes); glyphs.setPositions(positions); return glyphs; } -void tst_QGlyphs::copyConstructor() +void tst_QGlyphRun::copyConstructor() { - QGlyphs glyphs; + QGlyphRun glyphs; { QVector<quint32> glyphIndexes; @@ -146,40 +146,40 @@ void tst_QGlyphs::copyConstructor() positions.append(QPointF(3, 4)); positions.append(QPointF(5, 6)); - glyphs.setFont(QRawFont::fromFont(font)); + glyphs.setRawFont(QRawFont::fromFont(font)); glyphs.setGlyphIndexes(glyphIndexes); glyphs.setPositions(positions); } - QGlyphs otherGlyphs(glyphs); - QCOMPARE(otherGlyphs.font(), glyphs.font()); + QGlyphRun otherGlyphs(glyphs); + QCOMPARE(otherGlyphs.rawFont(), glyphs.rawFont()); QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes()); QCOMPARE(glyphs.positions(), otherGlyphs.positions()); } -void tst_QGlyphs::assignment() +void tst_QGlyphRun::assignment() { - QGlyphs glyphs(make_dummy_indexes()); + QGlyphRun glyphs(make_dummy_indexes()); - QGlyphs otherGlyphs = glyphs; - QCOMPARE(otherGlyphs.font(), glyphs.font()); + QGlyphRun otherGlyphs = glyphs; + QCOMPARE(otherGlyphs.rawFont(), glyphs.rawFont()); QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes()); QCOMPARE(glyphs.positions(), otherGlyphs.positions()); } -void tst_QGlyphs::equalsOperator_data() +void tst_QGlyphRun::equalsOperator_data() { - QTest::addColumn<QGlyphs>("one"); - QTest::addColumn<QGlyphs>("two"); + QTest::addColumn<QGlyphRun>("one"); + QTest::addColumn<QGlyphRun>("two"); QTest::addColumn<bool>("equals"); - QGlyphs one(make_dummy_indexes()); - QGlyphs two(make_dummy_indexes()); + QGlyphRun one(make_dummy_indexes()); + QGlyphRun two(make_dummy_indexes()); QTest::newRow("Identical") << one << two << true; { - QGlyphs busted(two); + QGlyphRun busted(two); QVector<QPointF> positions = busted.positions(); positions[2] += QPointF(1, 1); @@ -190,17 +190,17 @@ void tst_QGlyphs::equalsOperator_data() } { - QGlyphs busted(two); + QGlyphRun busted(two); QFont font; - font.setPixelSize(busted.font().pixelSize() * 2); - busted.setFont(QRawFont::fromFont(font)); + font.setPixelSize(busted.rawFont().pixelSize() * 2); + busted.setRawFont(QRawFont::fromFont(font)); QTest::newRow("Different fonts") << one << busted << false; } { - QGlyphs busted(two); + QGlyphRun busted(two); QVector<quint32> glyphIndexes = busted.glyphIndexes(); glyphIndexes[2] += 1; @@ -211,10 +211,10 @@ void tst_QGlyphs::equalsOperator_data() } -void tst_QGlyphs::equalsOperator() +void tst_QGlyphRun::equalsOperator() { - QFETCH(QGlyphs, one); - QFETCH(QGlyphs, two); + QFETCH(QGlyphRun, one); + QFETCH(QGlyphRun, two); QFETCH(bool, equals); QCOMPARE(one == two, equals); @@ -222,7 +222,7 @@ void tst_QGlyphs::equalsOperator() } -void tst_QGlyphs::textLayoutGlyphIndexes() +void tst_QGlyphRun::textLayoutGlyphIndexes() { QString s; s.append(QLatin1Char('A')); @@ -234,17 +234,17 @@ void tst_QGlyphs::textLayoutGlyphIndexes() layout.createLine(); layout.endLayout(); - QList<QGlyphs> listOfGlyphs = layout.glyphs(); + QList<QGlyphRun> listOfGlyphs = layout.glyphRuns(); QCOMPARE(listOfGlyphs.size(), 1); - QGlyphs glyphs = listOfGlyphs.at(0); + QGlyphRun glyphs = listOfGlyphs.at(0); QCOMPARE(glyphs.glyphIndexes().size(), 2); QCOMPARE(glyphs.glyphIndexes().at(0), quint32(2)); QCOMPARE(glyphs.glyphIndexes().at(1), quint32(1)); } -void tst_QGlyphs::drawExistingGlyphs() +void tst_QGlyphRun::drawExistingGlyphs() { QPixmap textLayoutDraw(1000, 1000); QPixmap drawGlyphs(1000, 1000); @@ -267,13 +267,13 @@ void tst_QGlyphs::drawExistingGlyphs() layout.draw(&p, QPointF(50, 50)); } - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); { QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -284,7 +284,7 @@ void tst_QGlyphs::drawExistingGlyphs() QCOMPARE(textLayoutDraw, drawGlyphs); } -void tst_QGlyphs::drawNonExistentGlyphs() +void tst_QGlyphRun::drawNonExistentGlyphs() { QVector<quint32> glyphIndexes; glyphIndexes.append(3); @@ -292,10 +292,10 @@ void tst_QGlyphs::drawNonExistentGlyphs() QVector<QPointF> glyphPositions; glyphPositions.append(QPointF(0, 0)); - QGlyphs glyphs; + QGlyphRun glyphs; glyphs.setGlyphIndexes(glyphIndexes); glyphs.setPositions(glyphPositions); - glyphs.setFont(QRawFont::fromFont(m_testFont)); + glyphs.setRawFont(QRawFont::fromFont(m_testFont)); QPixmap image(1000, 1000); image.fill(Qt::white); @@ -303,7 +303,7 @@ void tst_QGlyphs::drawNonExistentGlyphs() QPixmap imageBefore = image; { QPainter p(&image); - p.drawGlyphs(QPointF(50, 50), glyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -313,7 +313,7 @@ void tst_QGlyphs::drawNonExistentGlyphs() QCOMPARE(image, imageBefore); // Should be unchanged } -void tst_QGlyphs::drawMultiScriptText1() +void tst_QGlyphRun::drawMultiScriptText1() { QString text; text += QChar(0x03D0); // Greek, beta @@ -329,7 +329,7 @@ void tst_QGlyphs::drawMultiScriptText1() QPixmap drawGlyphs(1000, 1000); drawGlyphs.fill(Qt::white); - QList<QGlyphs> glyphsList = textLayout.glyphs(); + QList<QGlyphRun> glyphsList = textLayout.glyphRuns(); QCOMPARE(glyphsList.size(), 1); { @@ -339,8 +339,8 @@ void tst_QGlyphs::drawMultiScriptText1() { QPainter p(&drawGlyphs); - foreach (QGlyphs glyphs, glyphsList) - p.drawGlyphs(QPointF(50, 50), glyphs); + foreach (QGlyphRun glyphs, glyphsList) + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -352,7 +352,7 @@ void tst_QGlyphs::drawMultiScriptText1() } -void tst_QGlyphs::drawMultiScriptText2() +void tst_QGlyphRun::drawMultiScriptText2() { QString text; text += QChar(0x0621); // Arabic, Hamza @@ -369,7 +369,7 @@ void tst_QGlyphs::drawMultiScriptText2() QPixmap drawGlyphs(1000, 1000); drawGlyphs.fill(Qt::white); - QList<QGlyphs> glyphsList = textLayout.glyphs(); + QList<QGlyphRun> glyphsList = textLayout.glyphRuns(); QCOMPARE(glyphsList.size(), 2); { @@ -379,8 +379,8 @@ void tst_QGlyphs::drawMultiScriptText2() { QPainter p(&drawGlyphs); - foreach (QGlyphs glyphs, glyphsList) - p.drawGlyphs(QPointF(50, 50), glyphs); + foreach (QGlyphRun glyphs, glyphsList) + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -391,13 +391,13 @@ void tst_QGlyphs::drawMultiScriptText2() QCOMPARE(drawGlyphs, textLayoutDraw); } -void tst_QGlyphs::detach() +void tst_QGlyphRun::detach() { - QGlyphs glyphs; + QGlyphRun glyphs; glyphs.setGlyphIndexes(QVector<quint32>() << 1 << 2 << 3); - QGlyphs otherGlyphs; + QGlyphRun otherGlyphs; otherGlyphs = glyphs; QCOMPARE(otherGlyphs.glyphIndexes(), glyphs.glyphIndexes()); @@ -408,7 +408,7 @@ void tst_QGlyphs::detach() QCOMPARE(glyphs.glyphIndexes(), QVector<quint32>() << 1 << 2 << 3); } -void tst_QGlyphs::drawStruckOutText() +void tst_QGlyphRun::drawStruckOutText() { QPixmap textLayoutDraw(1000, 1000); QPixmap drawGlyphs(1000, 1000); @@ -432,13 +432,13 @@ void tst_QGlyphs::drawStruckOutText() layout.draw(&p, QPointF(50, 50)); } - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); { QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -449,7 +449,7 @@ void tst_QGlyphs::drawStruckOutText() QCOMPARE(textLayoutDraw, drawGlyphs); } -void tst_QGlyphs::drawOverlinedText() +void tst_QGlyphRun::drawOverlinedText() { QPixmap textLayoutDraw(1000, 1000); QPixmap drawGlyphs(1000, 1000); @@ -473,13 +473,13 @@ void tst_QGlyphs::drawOverlinedText() layout.draw(&p, QPointF(50, 50)); } - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); { QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -490,7 +490,7 @@ void tst_QGlyphs::drawOverlinedText() QCOMPARE(textLayoutDraw, drawGlyphs); } -void tst_QGlyphs::drawUnderlinedText() +void tst_QGlyphRun::drawUnderlinedText() { QPixmap textLayoutDraw(1000, 1000); QPixmap drawGlyphs(1000, 1000); @@ -514,13 +514,13 @@ void tst_QGlyphs::drawUnderlinedText() layout.draw(&p, QPointF(50, 50)); } - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); { QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -531,7 +531,7 @@ void tst_QGlyphs::drawUnderlinedText() QCOMPARE(textLayoutDraw, drawGlyphs); } -void tst_QGlyphs::drawRightToLeft() +void tst_QGlyphRun::drawRightToLeft() { QString s; s.append(QChar(1575)); @@ -557,13 +557,13 @@ void tst_QGlyphs::drawRightToLeft() layout.draw(&p, QPointF(50, 50)); } - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); { QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); } #if defined(DEBUG_SAVE_IMAGE) @@ -577,6 +577,6 @@ void tst_QGlyphs::drawRightToLeft() #endif // QT_NO_RAWFONT -QTEST_MAIN(tst_QGlyphs) -#include "tst_qglyphs.moc" +QTEST_MAIN(tst_QGlyphRun) +#include "tst_qglyphrun.moc" diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index f45481c..d5d9029 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -3815,7 +3815,7 @@ void tst_QLineEdit::bidiVisualMovement() QLineEdit le; le.setText(logical); - le.setCursorMoveStyle(QTextCursor::Visual); + le.setCursorMoveStyle(Qt::VisualMoveStyle); le.setCursorPosition(0); bool moved; @@ -3863,7 +3863,7 @@ void tst_QLineEdit::bidiLogicalMovement() QLineEdit le; le.setText(logical); - le.setCursorMoveStyle(QTextCursor::Logical); + le.setCursorMoveStyle(Qt::LogicalMoveStyle); le.setCursorPosition(0); bool moved; diff --git a/tests/auto/qrawfont/tst_qrawfont.cpp b/tests/auto/qrawfont/tst_qrawfont.cpp index 4b42c74..8c58407 100644 --- a/tests/auto/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/qrawfont/tst_qrawfont.cpp @@ -91,6 +91,9 @@ private slots: void unsupportedWritingSystem_data(); void unsupportedWritingSystem(); + + void rawFontSetPixelSize_data(); + void rawFontSetPixelSize(); #endif // QT_NO_RAWFONT }; @@ -293,12 +296,12 @@ void tst_QRawFont::textLayout() layout.createLine(); layout.endLayout(); - QList<QGlyphs> glyphss = layout.glyphs(); - QCOMPARE(glyphss.size(), 1); + QList<QGlyphRun> glyphRuns = layout.glyphRuns(); + QCOMPARE(glyphRuns.size(), 1); - QGlyphs glyphs = glyphss.at(0); + QGlyphRun glyphs = glyphRuns.at(0); - QRawFont rawFont = glyphs.font(); + QRawFont rawFont = glyphs.rawFont(); QVERIFY(rawFont.isValid()); QCOMPARE(rawFont.familyName(), familyName); QCOMPARE(rawFont.pixelSize(), 18.0); @@ -792,11 +795,11 @@ void tst_QRawFont::unsupportedWritingSystem() layout.createLine(); layout.endLayout(); - QList<QGlyphs> glyphss = layout.glyphs(); - QCOMPARE(glyphss.size(), 1); + QList<QGlyphRun> glyphRuns = layout.glyphRuns(); + QCOMPARE(glyphRuns.size(), 1); - QGlyphs glyphs = glyphss.at(0); - QRawFont layoutFont = glyphs.font(); + QGlyphRun glyphs = glyphRuns.at(0); + QRawFont layoutFont = glyphs.rawFont(); QVERIFY(layoutFont.familyName() != QString::fromLatin1("QtBidiTestFont")); QCOMPARE(layoutFont.pixelSize(), 12.0); @@ -807,6 +810,39 @@ void tst_QRawFont::unsupportedWritingSystem() fontDatabase.removeApplicationFont(id); } +void tst_QRawFont::rawFontSetPixelSize_data() +{ + QTest::addColumn<QFont::HintingPreference>("hintingPreference"); + + QTest::newRow("Default hinting preference") << QFont::PreferDefaultHinting; + QTest::newRow("No hinting preference") << QFont::PreferNoHinting; + QTest::newRow("Vertical hinting preference") << QFont::PreferVerticalHinting; + QTest::newRow("Full hinting preference") << QFont::PreferFullHinting; +} + +void tst_QRawFont::rawFontSetPixelSize() +{ + QFETCH(QFont::HintingPreference, hintingPreference); + + QTextLayout layout("Foobar"); + + QFont font = layout.font(); + font.setHintingPreference(hintingPreference); + font.setPixelSize(12); + layout.setFont(font); + + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + QGlyphRun glyphs = layout.glyphRuns().at(0); + QRawFont rawFont = glyphs.rawFont(); + QCOMPARE(rawFont.pixelSize(), 12.0); + + rawFont.setPixelSize(24); + QCOMPARE(rawFont.pixelSize(), 24.0); +} + #endif // QT_NO_RAWFONT QTEST_MAIN(tst_QRawFont) diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 5a64593..992d2f2 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -2292,7 +2292,7 @@ void tst_QTextEdit::bidiVisualMovement() option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); ed->document()->setDefaultTextOption(option); - ed->document()->setDefaultCursorMoveStyle(QTextCursor::Visual); + ed->document()->setDefaultCursorMoveStyle(Qt::VisualMoveStyle); ed->moveCursor(QTextCursor::Start); ed->show(); @@ -2346,7 +2346,7 @@ void tst_QTextEdit::bidiLogicalMovement() option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); ed->document()->setDefaultTextOption(option); - ed->document()->setDefaultCursorMoveStyle(QTextCursor::Logical); + ed->document()->setDefaultCursorMoveStyle(Qt::LogicalMoveStyle); ed->moveCursor(QTextCursor::Start); ed->show(); diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index 6ebe84e..3e65d7e 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -2650,7 +2650,6 @@ void tst_QVariant::invalidAsByteArray() void tst_QVariant::invalidQColor() const { QVariant va("An invalid QColor::name() value."); - QTest::ignoreMessage(QtWarningMsg, "QColor::setNamedColor: Unknown color name 'An invalid QColor::name() value.'"); QVERIFY(va.canConvert(QVariant::Color)); QVERIFY(!va.convert(QVariant::Color)); |