diff options
Diffstat (limited to 'tests/auto/other')
27 files changed, 300 insertions, 155 deletions
diff --git a/tests/auto/other/collections/tst_collections.cpp b/tests/auto/other/collections/tst_collections.cpp index e145cc17df..df622602c3 100644 --- a/tests/auto/other/collections/tst_collections.cpp +++ b/tests/auto/other/collections/tst_collections.cpp @@ -3359,7 +3359,7 @@ void testVectorAlignment() for (int i = 0; i < 200; ++i) container.append(Aligned()); - + for (int i = 0; i < container.size(); ++i) QCOMPARE(quintptr(&container.at(i)) % Aligned::PreferredAlignment, quintptr(0)); } diff --git a/tests/auto/other/lancelot/lancelot.pro b/tests/auto/other/lancelot/lancelot.pro index b577e0dbc9..ef557691e3 100644 --- a/tests/auto/other/lancelot/lancelot.pro +++ b/tests/auto/other/lancelot/lancelot.pro @@ -1,5 +1,6 @@ CONFIG += testcase CONFIG += parallel_test +CONFIG -= app_bundle TARGET = tst_lancelot QT += xml widgets testlib diff --git a/tests/auto/other/lancelot/scripts/background.qps b/tests/auto/other/lancelot/scripts/background.qps index 000cfcdd91..d1efe5c178 100644 --- a/tests/auto/other/lancelot/scripts/background.qps +++ b/tests/auto/other/lancelot/scripts/background.qps @@ -14,12 +14,12 @@ path_lineTo path 0 50 bitmap_load bitmap.png bitmap begin_block drawing - save + save drawRect 0 0 50 50 translate 60 0 drawEllipse 0 0 50 50 - + translate 60 0 drawPolygon [0 0 50 0 25 50 25 25] @@ -28,9 +28,9 @@ begin_block drawing translate 60 0 drawPie 0 0 50 50 1440 2000 - + translate 60 0 - drawChord 0 0 50 50 1440 2000 + drawChord 0 0 50 50 1440 2000 translate 60 0 drawLine 0 0 50 0 @@ -44,10 +44,10 @@ begin_block drawing drawArc 0 0 50 50 1440 2000 translate 60 0 - drawText 0 10 "Jambi-Bambi" + drawText 0 10 "Jambi-Bambi" translate 80 0 - drawPixmap bitmap 0 0 + drawPixmap bitmap 0 0 restore save @@ -57,7 +57,7 @@ begin_block drawing translate 60 0 drawEllipse 0 0 50 50 - + translate 60 0 drawPolygon [0 0 50 0 25 50 25 25] @@ -66,9 +66,9 @@ begin_block drawing translate 60 0 drawPie 0 0 50 50 1440 2000 - + translate 60 0 - drawChord 0 0 50 50 1440 2000 + drawChord 0 0 50 50 1440 2000 translate 60 0 drawLine 0 0 50 0 @@ -82,10 +82,10 @@ begin_block drawing drawArc 0 0 50 50 1440 2000 translate 60 0 - drawText 0 10 "Jambi-Bambi" + drawText 0 10 "Jambi-Bambi" translate 80 0 - drawPixmap bitmap 0 0 + drawPixmap bitmap 0 0 restore end_block @@ -102,12 +102,12 @@ repeat_block drawing translate 0 160 setBackgroundMode Transparent setPen ff7f7f 4 dashline flatcap beveljoin -repeat_block drawing +repeat_block drawing translate 0 160 setBackgroundMode OpaqueMode setPen ff7f7f 4 dashline flatcap beveljoin -repeat_block drawing +repeat_block drawing resetMatrix diff --git a/tests/auto/other/lancelot/scripts/bitmaps.qps b/tests/auto/other/lancelot/scripts/bitmaps.qps index a816b9d497..4966490337 100644 --- a/tests/auto/other/lancelot/scripts/bitmaps.qps +++ b/tests/auto/other/lancelot/scripts/bitmaps.qps @@ -122,12 +122,12 @@ translate 110 0 save translate 20 -10 rotate 10 - setBackgroundMode Transparent + setBackgroundMode Transparent repeat_block draw_subrected restore translate 110 0 -save +save translate 20 -10 rotate 10 setBackgroundMode Opaque diff --git a/tests/auto/other/lancelot/scripts/clippaths.qps b/tests/auto/other/lancelot/scripts/clippaths.qps index fba89784df..fe8e198a17 100644 --- a/tests/auto/other/lancelot/scripts/clippaths.qps +++ b/tests/auto/other/lancelot/scripts/clippaths.qps @@ -4,7 +4,7 @@ path_addRect hor 0 0 50 10 path_addRect ver 0 0 10 50 -translate 10 10 +translate 10 10 setPen NoPen begin_block clipping @@ -13,7 +13,7 @@ save setBrush 0x7f7fff save setClipPath hor - drawRect 0 0 100 100 + drawRect 0 0 100 100 setClipPath ver IntersectClip setBrush black CrossPattern @@ -21,18 +21,18 @@ save restore translate 100 0 - save + save setClipPath hor drawRect 0 0 100 100 setClipPath ver ReplaceClip setBrush black CrossPattern - drawRect 0 0 100 100 + drawRect 0 0 100 100 restore translate 100 0 - save - setClipPath hor + save + setClipPath hor drawRect 0 0 100 100 setClipPath ver UniteClip diff --git a/tests/auto/other/lancelot/scripts/cliprects.qps b/tests/auto/other/lancelot/scripts/cliprects.qps index 0d28b035b4..aa0367eccf 100644 --- a/tests/auto/other/lancelot/scripts/cliprects.qps +++ b/tests/auto/other/lancelot/scripts/cliprects.qps @@ -3,7 +3,7 @@ -translate 10 10 +translate 10 10 setPen NoPen begin_block clipping @@ -11,8 +11,8 @@ save setBrush 0x7f7fff save - setClipRect 0 0 50 10 - drawRect 0 0 100 100 + setClipRect 0 0 50 10 + drawRect 0 0 100 100 setClipRect 0 0 10 50 IntersectClip setBrush black CrossPattern @@ -20,17 +20,17 @@ save restore translate 100 0 - save + save setClipRect 0 0 50 10 drawRect 0 0 100 100 setClipRect 0 0 10 50 ReplaceClip setBrush black CrossPattern - drawRect 0 0 100 100 + drawRect 0 0 100 100 restore translate 100 0 - save + save setClipRect 0 0 50 10 drawRect 0 0 100 100 diff --git a/tests/auto/other/lancelot/scripts/conical_gradients.qps b/tests/auto/other/lancelot/scripts/conical_gradients.qps index 2e897b1813..d6eb860f3f 100644 --- a/tests/auto/other/lancelot/scripts/conical_gradients.qps +++ b/tests/auto/other/lancelot/scripts/conical_gradients.qps @@ -64,7 +64,7 @@ setBrush nobrush begin_block ellipse_draw setClipRect 0 0 100 100 drawEllipse 35 35 11 11 - save + save translate 40 40 rotate -50 drawLine -100 0 100 0 diff --git a/tests/auto/other/lancelot/scripts/dashes.qps b/tests/auto/other/lancelot/scripts/dashes.qps index 649f56cf66..185443a292 100644 --- a/tests/auto/other/lancelot/scripts/dashes.qps +++ b/tests/auto/other/lancelot/scripts/dashes.qps @@ -15,7 +15,7 @@ save setPen black 1 SolidLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 SolidLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -25,7 +25,7 @@ save setPen black 2 SolidLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 SolidLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -36,8 +36,8 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - - + + translate 100 0 save setPen black 1 DotLine FlatCap BevelJoin @@ -49,7 +49,7 @@ save setPen black 1 DotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -59,7 +59,7 @@ save setPen black 2 DotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 DotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -70,7 +70,7 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - + translate 100 0 save setPen black 1 DashLine FlatCap BevelJoin @@ -82,7 +82,7 @@ save setPen black 1 DashLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DashLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -92,7 +92,7 @@ save setPen black 2 DashLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 DashLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -103,9 +103,9 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - + translate 100 0 - + save setPen black 1 DashDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] @@ -116,7 +116,7 @@ save setPen black 1 DashDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DashDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -126,7 +126,7 @@ save setPen black 2 DashDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 DashDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -137,7 +137,7 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - + translate 100 0 save @@ -150,7 +150,7 @@ save setPen black 1 DashDotDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DashDotDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -160,7 +160,7 @@ save setPen black 2 DashDotDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 4 DashDotDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -187,7 +187,7 @@ save pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 SolidLine FlatCap BevelJoin pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] @@ -200,7 +200,7 @@ save pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 4 SolidLine FlatCap BevelJoin pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] @@ -217,7 +217,7 @@ save restore end_block - + translate 0 400 setRenderHint Antialiasing repeat_block draw diff --git a/tests/auto/other/lancelot/scripts/deviceclipping.qps b/tests/auto/other/lancelot/scripts/deviceclipping.qps index cedfc1e363..8608a50994 100644 --- a/tests/auto/other/lancelot/scripts/deviceclipping.qps +++ b/tests/auto/other/lancelot/scripts/deviceclipping.qps @@ -22,7 +22,7 @@ begin_block drawing drawRect 300 -500000 1000000 1000000 drawPath path - + end_block save diff --git a/tests/auto/other/lancelot/scripts/pixmap_scaling.qps b/tests/auto/other/lancelot/scripts/pixmap_scaling.qps index 651896f4a3..8a5ab2c60e 100644 --- a/tests/auto/other/lancelot/scripts/pixmap_scaling.qps +++ b/tests/auto/other/lancelot/scripts/pixmap_scaling.qps @@ -8,8 +8,8 @@ translate 5 25 setFont "arial" 8 -save - drawText 15 0 "opaque image" +save + drawText 15 0 "opaque image" translate 50 50 save translate 1 1 @@ -21,23 +21,23 @@ save scale -20 20 drawImage solid2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawImage solid2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawImage solid2x2.png 0 0 restore - -restore + +restore save translate 150 0 - drawText 15 0 "alpha image" + drawText 15 0 "alpha image" translate 50 50 save translate 1 1 @@ -49,12 +49,12 @@ save scale -20 20 drawImage alpha2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawImage alpha2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawImage alpha2x2.png 0 0 @@ -64,7 +64,7 @@ restore save translate 0 150 - drawText 15 0 "solid pixmap" + drawText 15 0 "solid pixmap" translate 50 50 save translate 1 1 @@ -76,12 +76,12 @@ save scale -20 20 drawPixmap solid2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawPixmap solid2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawPixmap solid2x2.png 0 0 @@ -90,9 +90,9 @@ restore save - translate 150 150 + translate 150 150 drawText 15 0 "alpha pixmap" - translate 50 50 + translate 50 50 save translate 1 1 scale 20 20 @@ -103,12 +103,12 @@ save scale -20 20 drawPixmap alpha2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawPixmap alpha2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawPixmap alpha2x2.png 0 0 @@ -116,7 +116,7 @@ save restore -save +save translate 300 10 save drawText 0 -10 "subrect solid image" @@ -143,7 +143,7 @@ save drawImage solid2x2.png 45 0 5 50 1.8 0 0.2 2 restore - save + save translate 150 0 drawText 0 -10 "subrect solid image" drawImage alpha2x2.png 0 0 50 5 0 0.0 2 0.2 @@ -156,7 +156,7 @@ save drawImage alpha2x2.png 0 35 50 5 0 1.4 2 0.2 drawImage alpha2x2.png 0 40 50 5 0 1.6 2 0.2 drawImage alpha2x2.png 0 45 50 5 0 1.8 2 0.2 - translate 60 0 + translate 60 0 drawImage alpha2x2.png 0 0 5 50 0.0 0 0.2 2 drawImage alpha2x2.png 5 0 5 50 0.2 0 0.2 2 drawImage alpha2x2.png 10 0 5 50 0.4 0 0.2 2 diff --git a/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps b/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps index 908f7c3465..d5b7b92fc9 100644 --- a/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps +++ b/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps @@ -6,7 +6,7 @@ translate 50 50 # Pixmaps at 0.1 offset, unclipped begin_block draw_pixmaps -save +save drawPixmap border.png 0 0 translate 20.1 0.1 drawPixmap border.png 0 0 @@ -27,7 +27,7 @@ save translate 20.1 0.1 drawPixmap border.png 0 0 translate 20.1 0.1 - + drawPixmap border.png 0 0 translate 20.1 0.1 drawPixmap border.png 0 0 @@ -49,12 +49,12 @@ save drawPixmap border.png 0 0 translate 20.1 0.1 restore -end_block +end_block # Tiled pixmaps at 0.1 offsets, unclipped translate 0 50 begin_block draw_tiled -save +save drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 drawTiledPixmap border.png 0 0 16 16 0 0 @@ -75,7 +75,7 @@ save translate 20.1 0.1 drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 - + drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 drawTiledPixmap border.png 0 0 16 16 0 0 @@ -97,7 +97,7 @@ save drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 restore -end_block +end_block path_moveTo clip 0 0 diff --git a/tests/auto/other/lancelot/scripts/pixmaps.qps b/tests/auto/other/lancelot/scripts/pixmaps.qps index 8e60997acc..0b4ba2c4fb 100644 --- a/tests/auto/other/lancelot/scripts/pixmaps.qps +++ b/tests/auto/other/lancelot/scripts/pixmaps.qps @@ -15,13 +15,13 @@ save drawPixmap the_pixmap 0 0 # sub recting - translate 120 0 + translate 120 0 drawPixmap the_pixmap 0 0 40 40 0 0 40 40 drawPixmap the_pixmap 60 0 40 40 60 0 40 40 drawPixmap the_pixmap 0 60 40 40 0 60 40 40 drawPixmap the_pixmap 60 60 40 40 60 60 40 40 drawPixmap the_pixmap 0 40 40 20 0 40 40 20 - drawPixmap the_pixmap 60 40 40 20 60 40 40 20 + drawPixmap the_pixmap 60 40 40 20 60 40 40 20 drawPixmap the_pixmap 40 0 20 100 40 0 20 100 # subrecting w/scale @@ -30,15 +30,15 @@ save drawPixmap the_pixmap 50 0 50 50 25 0 25 25 drawPixmap the_pixmap 0 50 50 50 0 25 25 25 drawPixmap the_pixmap 50 50 50 50 25 25 25 25 - + # subrecting w/scale & smooth xform translate 120 0 - setRenderHint SmoothPixmapTransformation + setRenderHint SmoothPixmapTransformation drawPixmap the_pixmap 0 0 50 50 0 0 25 25 drawPixmap the_pixmap 50 0 50 50 25 0 25 25 drawPixmap the_pixmap 0 50 50 50 0 25 25 25 drawPixmap the_pixmap 50 50 50 50 25 25 25 25 - + # Rotation w/o smooth xform translate 120 0 diff --git a/tests/auto/other/lancelot/scripts/rasterops.qps b/tests/auto/other/lancelot/scripts/rasterops.qps index 21f943b543..d0f2da42df 100644 --- a/tests/auto/other/lancelot/scripts/rasterops.qps +++ b/tests/auto/other/lancelot/scripts/rasterops.qps @@ -13,9 +13,9 @@ begin_block drawShape setBrush 0xffff0000 drawEllipse 5 5 30 30 setBrush 0xff00ff00 - drawRect 0 0 20 20 + drawRect 0 0 20 20 setBrush 0xff0000ff - drawRect 20 20 20 20 + drawRect 20 20 20 20 end_block begin_block loop diff --git a/tests/auto/other/lancelot/scripts/sizes.qps b/tests/auto/other/lancelot/scripts/sizes.qps index 68e01c3262..12b0f4af1e 100644 --- a/tests/auto/other/lancelot/scripts/sizes.qps +++ b/tests/auto/other/lancelot/scripts/sizes.qps @@ -4,7 +4,7 @@ setPen NoPen setBrush black -translate 10 10 +translate 10 10 begin_block testblock drawRect 0 0 10 10 @@ -75,9 +75,9 @@ drawChord 180 100 19 19 0 4320 end_block -setPen red +setPen red translate 0 150 -repeat_block testblock +repeat_block testblock setRenderHint LineAntialiasing diff --git a/tests/auto/other/lancelot/scripts/statictext.qps b/tests/auto/other/lancelot/scripts/statictext.qps index b62b623462..c5ddda197f 100644 --- a/tests/auto/other/lancelot/scripts/statictext.qps +++ b/tests/auto/other/lancelot/scripts/statictext.qps @@ -50,7 +50,25 @@ save drawStaticText 0 80 "scaled sansserif 10pt, bold italic" restore - translate 0 100 + translate 200 200 + setPen black + save + scale -1 -1 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "flipped sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "flipped sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "flipped sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "flipped sansserif 10pt, bold italic" + restore + + translate -200 20 setPen black save translate 200 90 @@ -91,26 +109,26 @@ restore end_block translate 250 0 -drawStaticText 25 520 "clipped to rectangle" +drawStaticText 25 640 "clipped to rectangle" save setPen #3f000000 setBrush nobrush - drawRect 20 0 100 500 - setClipRect 20 0 100 500 + drawRect 20 0 100 620 + setClipRect 20 0 100 620 setPen black repeat_block text_drawing restore translate 150 0 -drawStaticText 25 520 "clipped to path" +drawStaticText 25 640 "clipped to path" save path_moveTo clip 20 0 path_cubicTo clip 0 200 40 400 20 400 - path_lineTo clip 30 500 + path_lineTo clip 30 620 path_lineTo clip 30 0 path_lineTo clip 40 0 - path_lineTo clip 40 500 - path_lineTo clip 120 500 + path_lineTo clip 40 620 + path_lineTo clip 120 620 path_lineTo clip 120 0 path_lineTo clip 20 0 setPen #3f000000 diff --git a/tests/auto/other/lancelot/scripts/text.qps b/tests/auto/other/lancelot/scripts/text.qps index d7ee83290b..e7d47448ea 100644 --- a/tests/auto/other/lancelot/scripts/text.qps +++ b/tests/auto/other/lancelot/scripts/text.qps @@ -7,112 +7,130 @@ begin_block text_drawing save setFont "sansserif" 10 normal drawText 0 20 "sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "sansserif 10pt, bold italic" - - + + translate 0 100 setPen #7fff0000 - + setFont "sansserif" 10 normal drawText 0 20 "alpha sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "alpha sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "alpha sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "alpha sansserif 10pt, bold italic" - - + + translate 0 100 setPen black save scale 0.9 0.9 - + setFont "sansserif" 10 normal drawText 0 20 "scaled sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "scaled sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "scaled sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "scaled sansserif 10pt, bold italic" restore - translate 0 100 + translate 200 200 + setPen black + save + scale -1 -1 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "flipped sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "flipped sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "flipped sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "flipped sansserif 10pt, bold italic" + restore + + translate -200 20 setPen black save translate 200 90 rotate 185 - + setFont "sansserif" 10 normal drawText 0 20 "scaled sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "scaled sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "scaled sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "scaled sansserif 10pt, bold italic" restore - + translate 0 100 gradient_appendStop 0 red gradient_appendStop 0.5 #00ff00 gradient_appendStop 1 blue gradient_setLinear 0 0 200 0 setPen brush - + setFont "sansserif" 10 normal drawText 0 0 "gradient sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 20 "gradient sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 40 "gradient sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 60 "gradient sansserif 10pt, bold italic" restore end_block translate 250 0 -drawText 25 520 "clipped to rectangle" +drawText 25 640 "clipped to rectangle" save setPen #3f000000 setBrush nobrush - drawRect 20 0 100 500 - setClipRect 20 0 100 500 + drawRect 20 0 100 620 + setClipRect 20 0 100 620 setPen black repeat_block text_drawing restore translate 150 0 -drawText 25 520 "clipped to path" -save +drawText 25 640 "clipped to path" +save path_moveTo clip 20 0 path_cubicTo clip 0 200 40 400 20 400 - path_lineTo clip 30 500 + path_lineTo clip 30 620 path_lineTo clip 30 0 path_lineTo clip 40 0 - path_lineTo clip 40 500 - path_lineTo clip 120 500 + path_lineTo clip 40 620 + path_lineTo clip 120 620 path_lineTo clip 120 0 path_lineTo clip 20 0 setPen #3f000000 diff --git a/tests/auto/other/lancelot/scripts/tiled_pixmap.qps b/tests/auto/other/lancelot/scripts/tiled_pixmap.qps index 9cb5e0dd1f..0ce3a7834c 100644 --- a/tests/auto/other/lancelot/scripts/tiled_pixmap.qps +++ b/tests/auto/other/lancelot/scripts/tiled_pixmap.qps @@ -5,7 +5,7 @@ translate 0 10 setRenderHint Antialiasing -pixmap_load dome_argb32 the_pixmap +pixmap_load dome_argb32 the_pixmap begin_block draw_stuff save @@ -25,7 +25,7 @@ save setRenderHint SmoothPixmapTransform false drawTiledPixmap the_pixmap 0 0 150 100 25 25 restore - + # xformed with smooth xform translate 160 0 save @@ -38,17 +38,17 @@ restore end_block translate 0 120 -pixmap_load dome_rgb32 the_pixmap +pixmap_load dome_rgb32 the_pixmap repeat_block draw_stuff translate 0 120 -pixmap_load dome_indexed the_pixmap +pixmap_load dome_indexed the_pixmap repeat_block draw_stuff translate 0 120 -pixmap_load dome_indexed_mask the_pixmap +pixmap_load dome_indexed_mask the_pixmap repeat_block draw_stuff diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp index d4af5c1386..93e9db9a61 100644 --- a/tests/auto/other/macgui/guitest.cpp +++ b/tests/auto/other/macgui/guitest.cpp @@ -118,10 +118,10 @@ QAccessibleInterface *WidgetNavigator::recursiveSearch(TestBase *test, QAccessib while (todoInterfaces.isEmpty() == false) { QAccessibleInterface *testInterface = todoInterfaces.pop(); - + if ((*test)(testInterface)) return testInterface; - + const int numChildren = testInterface->childCount(); for (int i = 0; i < numChildren; ++i) { QAccessibleInterface *childInterface = testInterface->child(i); @@ -160,17 +160,17 @@ namespace NativeEvents { CGPoint position; position.x = globalPos.x(); position.y = globalPos.y(); - + const bool updateMousePosition = (updateMouse == UpdatePosition); - + // Mouse down. - CGPostMouseEvent(position, updateMousePosition, 3, - (buttons & Qt::LeftButton) ? true : false, - (buttons & Qt::MidButton/* Middlebutton! */) ? true : false, + CGPostMouseEvent(position, updateMousePosition, 3, + (buttons & Qt::LeftButton) ? true : false, + (buttons & Qt::MidButton/* Middlebutton! */) ? true : false, (buttons & Qt::RightButton) ? true : false); // Mouse up. - CGPostMouseEvent(position, updateMousePosition, 3, false, false, false); + CGPostMouseEvent(position, updateMousePosition, 3, false, false, false); } #else # error Oops, NativeEvents::mouseClick() is not implemented on this platform. @@ -200,7 +200,7 @@ bool checkPixel(QColor pixel, QColor expected) } /* - Tests that the pixels inside rect in image all have the given color. + Tests that the pixels inside rect in image all have the given color. */ bool GuiTester::isFilled(const QImage image, const QRect &rect, const QColor &color) { @@ -218,7 +218,7 @@ bool GuiTester::isFilled(const QImage image, const QRect &rect, const QColor &co /* Tests that stuff is painted to the pixels inside rect. - This test fails if any lines in the given direction have pixels + This test fails if any lines in the given direction have pixels of only one color. */ bool GuiTester::isContent(const QImage image, const QRect &rect, Directions directions) @@ -239,7 +239,7 @@ bool GuiTester::isContent(const QImage image, const QRect &rect, Directions dire } } return true; - } + } if (directions & Vertical) { for (int x = rect.left(); x <= rect.right(); ++x) { diff --git a/tests/auto/other/macgui/guitest.h b/tests/auto/other/macgui/guitest.h index 1b5f933769..2d02cce720 100644 --- a/tests/auto/other/macgui/guitest.h +++ b/tests/auto/other/macgui/guitest.h @@ -70,12 +70,12 @@ public: void printAll(QWidget *widget); void printAll(QAccessibleInterface *interface); - + QAccessibleInterface *find(QAccessible::Text textType, const QString &text, QWidget *start); QAccessibleInterface *find(QAccessible::Text textType, const QString &text, QAccessibleInterface *start); QAccessibleInterface *recursiveSearch(TestBase *test, QAccessibleInterface *iface); - + void deleteInDestructor(QAccessibleInterface * interface); static QWidget *getWidget(QAccessibleInterface *interface); private: @@ -99,7 +99,7 @@ class ColorWidget : public QWidget public: ColorWidget(QWidget *parent = 0, QColor color = QColor(Qt::red)) : QWidget(parent), color(color) {} - + QColor color; protected: @@ -139,7 +139,7 @@ private: }; /* - + */ class GuiTester : public QObject { diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp index cfe27095a8..e796b44843 100644 --- a/tests/auto/other/macgui/tst_macgui.cpp +++ b/tests/auto/other/macgui/tst_macgui.cpp @@ -41,7 +41,7 @@ #include <QApplication> -#include <QMessageBox> +#include <QMessageBox> #include <QtTest/QtTest> #include <QSplashScreen> #include <QScrollBar> @@ -55,7 +55,7 @@ class tst_MacGui : public GuiTester Q_OBJECT private slots: void scrollbarPainting(); - + void dummy(); void splashScreenModality(); void nonModalOrder(); @@ -216,7 +216,7 @@ void tst_MacGui::spinBoxArrowButtons() spinBox2.move(0, 100); colorWidget.show(); QTest::qWait(100); - + // Grab an unfocused spin box. const QImage noFocus = grabWindowContents(&colorWidget).toImage(); diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp index 3072d163c3..ae59672c72 100644 --- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp +++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp @@ -293,7 +293,7 @@ void tst_MacNativeEvents::testMouseEnter() void tst_MacNativeEvents::testChildDialogInFrontOfModalParent() { - // Test that a child dialog of a modal parent dialog is + // Test that a child dialog of a modal parent dialog is // in front of the parent, and active: QDialog parent; parent.setWindowModality(Qt::ApplicationModal); diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro index 35aaf4d48f..1f7582243e 100644 --- a/tests/auto/other/other.pro +++ b/tests/auto/other/other.pro @@ -42,6 +42,14 @@ SUBDIRS=\ qaccessibility \ qaccessibilitylinux \ +!qtHaveModule(network): SUBDIRS -= \ + baselineexample \ + headersclean \ + lancelot \ + networkselftest \ + qnetworkaccessmanager_and_qprogressdialog \ + qobjectperformance + testcocoon: SUBDIRS -= headersclean cross_compile: SUBDIRS -= \ diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro index 54a076b8fa..071b0bb66c 100644 --- a/tests/auto/other/qaccessibility/qaccessibility.pro +++ b/tests/auto/other/qaccessibility/qaccessibility.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_qaccessibility requires(contains(QT_CONFIG,accessibility)) -QT += widgets testlib gui-private +QT += testlib gui-private widgets-private SOURCES += tst_qaccessibility.cpp unix:!mac:LIBS+=-lm diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index b0d0459326..ab5b36cf69 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -58,7 +58,9 @@ #endif #include <QtTest/QtTest> #include <QtGui> +#include <QtGui/private/qaccessible2_p.h> #include <QtWidgets> +#include <QtWidgets/private/qaccessiblewidget_p.h> #include <math.h> #include <qpa/qplatformnativeinterface.h> @@ -768,12 +770,40 @@ void tst_QAccessibility::actionTest() void tst_QAccessibility::applicationTest() { + { QLatin1String name = QLatin1String("My Name"); qApp->setApplicationName(name); - QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(qApp); + QAIPtr interface(QAccessible::queryAccessibleInterface(qApp)); QCOMPARE(interface->text(QAccessible::Name), name); + QCOMPARE(interface->text(QAccessible::Description), qApp->applicationFilePath()); + QCOMPARE(interface->text(QAccessible::Value), QString()); QCOMPARE(interface->role(), QAccessible::Application); - delete interface; + QCOMPARE(interface->window(), static_cast<QWindow*>(0)); + QCOMPARE(interface->parent(), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->focusChild(), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->indexOfChild(0), -1); + QCOMPARE(interface->child(0), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->child(-1), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->child(1), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->childCount(), 0); + + QWidget widget; + widget.show(); + qApp->setActiveWindow(&widget); + QVERIFY(QTest::qWaitForWindowActive(&widget)); + + QAIPtr widgetIface(QAccessible::queryAccessibleInterface(&widget)); + QCOMPARE(interface->childCount(), 1); + QAIPtr focus(interface->focusChild()); + QCOMPARE(focus->object(), &widget); + QCOMPARE(interface->indexOfChild(0), -1); + QCOMPARE(interface->indexOfChild(widgetIface.data()), 0); + QAIPtr child(interface->child(0)); + QCOMPARE(child->object(), &widget); + QCOMPARE(interface->child(-1), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->child(1), static_cast<QAccessibleInterface*>(0)); + } + QTestAccessibility::clearEvents(); } void tst_QAccessibility::mainWindowTest() @@ -2702,6 +2732,76 @@ void tst_QAccessibility::tableTest() QCOMPARE(table2->rowDescription(1), QString("v2")); QCOMPARE(table2->rowDescription(2), QString("v3")); + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectItems); + tableView->setSelectionMode(QAbstractItemView::SingleSelection); + QVERIFY(!table2->selectRow(0)); + QVERIFY(!table2->isRowSelected(0)); + tableView->setSelectionBehavior(QAbstractItemView::SelectRows); + QVERIFY(table2->selectRow(0)); + QVERIFY(table2->selectRow(1)); + QVERIFY(!table2->isRowSelected(0)); + tableView->setSelectionMode(QAbstractItemView::MultiSelection); + QVERIFY(table2->selectRow(0)); + QVERIFY(table2->isRowSelected(1)); + QVERIFY(table2->unselectRow(0)); + QVERIFY(!table2->isRowSelected(0)); + tableView->setSelectionBehavior(QAbstractItemView::SelectColumns); + QVERIFY(!table2->selectRow(0)); + QVERIFY(!table2->isRowSelected(0)); + tableView->clearSelection(); + QCOMPARE(table2->selectedColumnCount(), 0); + QCOMPARE(table2->selectedRowCount(), 0); + QVERIFY(table2->selectColumn(1)); + QVERIFY(table2->isColumnSelected(1)); + tableView->clearSelection(); + tableView->setSelectionMode(QAbstractItemView::ContiguousSelection); + table2->selectColumn(0); + table2->selectColumn(2); + QVERIFY(!(table2->isColumnSelected(2) && table2->isColumnSelected(0))); + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectItems); + tableView->setSelectionMode(QAbstractItemView::MultiSelection); + table2->selectColumn(1); + table2->selectRow(1); + QVERIFY(table2->isColumnSelected(1)); + QVERIFY(table2->isRowSelected(1)); + + QAIPtr cell4(table2->cellAt(2,2)); + QVERIFY(cell1->actionInterface()); + QVERIFY(cell1->tableCellInterface()); + + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectRows); + tableView->setSelectionMode(QAbstractItemView::SingleSelection); + QVERIFY(!cell1->tableCellInterface()->isSelected()); + QVERIFY(cell1->actionInterface()->actionNames().contains(QAccessibleActionInterface::toggleAction())); + cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell2->tableCellInterface()->isSelected()); + + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectColumns); + cell3->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell4->tableCellInterface()->isSelected()); + + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectItems); + tableView->setSelectionMode(QAbstractItemView::SingleSelection); + cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell1->tableCellInterface()->isSelected()); + cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(!cell1->tableCellInterface()->isSelected()); + + tableView->clearSelection(); + tableView->setSelectionMode(QAbstractItemView::MultiSelection); + cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell1->tableCellInterface()->isSelected()); + QVERIFY(cell2->tableCellInterface()->isSelected()); + cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell1->tableCellInterface()->isSelected()); + QVERIFY(!cell2->tableCellInterface()->isSelected()); + delete tableView; QTestAccessibility::clearEvents(); diff --git a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp index c6cc50d97f..756a899b1b 100644 --- a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp +++ b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp @@ -82,7 +82,7 @@ public slots: QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile")); if (zeroCopy) request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 10*1024*1024); - + QNetworkReply *reply = netmanager.get( QNetworkRequest( QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile") diff --git a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp index 5bcaaf5543..68db218164 100644 --- a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp +++ b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp @@ -133,7 +133,7 @@ void compareScreenshots(const QString &image1, const QString &image2) QPainter p1(&screenShot); QPainter p2(&original); - //screenShot.save("scr1.png", "PNG"); + //screenShot.save("scr1.png", "PNG"); p1.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); p2.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); diff --git a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp index 64f87dc080..a96966a451 100644 --- a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp +++ b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp @@ -89,7 +89,7 @@ int main(int argc, char * argv[]) optionsMenu->addMenu("Settings"); optionsMenu->addMenu("Standard"); optionsMenu->addMenu("Extended"); - + QMenu *subMenu = helpMenu->addMenu("Help"); subMenu->addAction("Index"); subMenu->addSeparator(); |