diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-25 11:46:41 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-25 11:46:41 (GMT) |
commit | 8928e37c8b1b375e74c5981915c034123de11b3d (patch) | |
tree | 0dfa96087ca129f25d2e59265f73a046d75d274f /tests/auto/qstatictext/tst_qstatictext.cpp | |
parent | ef30a6f336d55c813423bf139d8363f50181179f (diff) | |
parent | 9e20aac8d44a0e3e3ac4c5d67376f50071987b91 (diff) | |
download | Qt-8928e37c8b1b375e74c5981915c034123de11b3d.zip Qt-8928e37c8b1b375e74c5981915c034123de11b3d.tar.gz Qt-8928e37c8b1b375e74c5981915c034123de11b3d.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (54 commits)
Better check in QStaticText testcase if xformed text is supported
Fix point drawing in QPainter.
Expand indicator would not be displayed after removal of a collapsed item's child
Avoid always detaching QStaticText
Doc: fix formatting
Make the qpainter test compile under Windows.
make QtScript compatible with mingw 64
Fix QStaticText test on QWS
Add licence header
Fixed a warning.
WinCE compilation fix
Fixed hypersensitive drag on QHeaderViews
Fix seg-fault when no X11 desktop environment is present
Remove comment in drawStaticTextItem() in GL engine
Separate Phonon and gstreamer defines in qtconfig
Revert "Updated WebKit from /home/jturcott/dev/webkit to qtwebkit-4.7-merged ( 5381ceeb37d97365cfb2f037650dbb4e495bca4e )"
Revert "Updated WebKit from /home/jturcott/dev/webkit to qtwebkit-4.7-merged ( 9303f6d67fb964b71ed3e7361367c3ccfaba5e0a )"
Fix compilation on Windows
Compile with QT_USE_FAST_OPERATOR_PLUS
Fix compilation error in openVG
...
Diffstat (limited to 'tests/auto/qstatictext/tst_qstatictext.cpp')
-rw-r--r-- | tests/auto/qstatictext/tst_qstatictext.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index 68f05c1..16832ad 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -45,13 +45,20 @@ #include <QtGui/QImage> #include <qstatictext.h> +#include <qpaintengine.h> + #include <private/qstatictext_p.h> +#include <private/qapplication_p.h> // #define DEBUG_SAVE_IMAGE class tst_QStaticText: public QObject { Q_OBJECT + +private: + bool supportsTransformations() const; + private slots: void init(); void cleanup(); @@ -177,6 +184,8 @@ void tst_QStaticText::prepareToCorrectData() p.drawStaticText(QPointF(11, 12), text); } + if (!supportsTransformations()) + QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort); QCOMPARE(imageDrawStaticText, imageDrawText); } @@ -288,6 +297,25 @@ void tst_QStaticText::translatedPainter() QCOMPARE(imageDrawStaticText, imageDrawText); } +bool tst_QStaticText::supportsTransformations() const +{ + QPixmap pm(10, 10); + QPainter p(&pm); + QPaintEngine *engine = p.paintEngine(); + + QPaintEngine::Type type = engine->type(); + + if (type == QPaintEngine::OpenGL2 + || type == QPaintEngine::OpenGL +#if !defined Q_WS_WIN + || type == QPaintEngine::Raster +#endif + ) + return false; + + return true; +} + void tst_QStaticText::rotatedPainter() { QPixmap imageDrawText(1000, 1000); @@ -314,6 +342,8 @@ void tst_QStaticText::rotatedPainter() imageDrawStaticText.save("rotatedPainter_imageDrawStaticText.png"); #endif + if (!supportsTransformations()) + QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort); QCOMPARE(imageDrawStaticText, imageDrawText); } @@ -340,6 +370,8 @@ void tst_QStaticText::scaledPainter() p.drawStaticText(QPointF(11, 12), text); } + if (!supportsTransformations()) + QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort); QCOMPARE(imageDrawStaticText, imageDrawText); } @@ -370,7 +402,6 @@ void tst_QStaticText::projectedPainter() } QCOMPARE(imageDrawStaticText, imageDrawText); - } void tst_QStaticText::rotatedScaledAndTranslatedPainter() @@ -405,6 +436,8 @@ void tst_QStaticText::rotatedScaledAndTranslatedPainter() imageDrawStaticText.save("rotatedScaledAndPainter_imageDrawStaticText.png"); #endif + if (!supportsTransformations()) + QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort); QCOMPARE(imageDrawStaticText, imageDrawText); } @@ -444,6 +477,8 @@ void tst_QStaticText::transformationChanged() imageDrawStaticText.save("transformationChanged_imageDrawStaticText.png"); #endif + if (!supportsTransformations()) + QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort); QCOMPARE(imageDrawStaticText, imageDrawText); } |